Home Search

DriveWorks Pro 21
Embedding a CPQ Order

Send Feedback

Embedding a CPQ Order

The ability to embed a CPQ Order is great if you want to surface CPQ to end customers who you do not want to access CPQ via the Dashboard\Portal.

This may be because you need to limit what they see (for example: comments, order discounts, etc.).

To embed a CPQ Order you will create a second CPQ DriveApp which links to the same database as your regular CPQ data.

This will mean that any data created in either DriveApp will be shared.

Your second CPQ DriveApp (which will be referred to as the Embed DriveApp from this point on) will need to configured slightly differently from the DriveApp Administration section of DriveWorks Administrator.

You will need to setup the following:

  • Your DriveApp Default Project will need to be driveApp-CPQ-Embed. This starts the Project from a different Project (rather than the usual Dashboard) .
  • Your DriveApp Start Parameters are used to pass various bits of information into the Embed DriveApp, so that it has access to the information that it needs to create CPQ Orders correctly.

There are a number of Start Parameters that can be used.

Some are required, some are optional.

Required Parameters:

  • Type - Used to determine what will be shown when the Embed DriveApp is first loaded. Type can either be set to Catalog or Item.
  • Name - Used to determine either the Category (if Type=Catalog) or Item (if Type=Item) will be shown when the Embed DriveApp is first shown. Should be the either the Category Name or Item Name.
  • OrderName - This simply needs to the name you want to give to the Order that will be created.
  • State - The name of State that you want to save the Order in when it is completed. This will not run any Transitions in the WorkFlow of the Order. If you want to run a Transition in your CPQ Workflow, use the WorkflowTransition Parameter.
  • ShowBasket - This can be set to either TRUE or FALSE depending on whether or not you want to send the user to a ‘Shopping Cart’ page after adding an Item. If this is set to false, the DriveApp will simply close.
  • Team - The name of the Team you want to associate the Order with.

Optional Parameters:

  • ShowDetails - This can be set to 1 of 4 things.
    • Both – will prompt the user running the DriveApp to create both a CPQ Account and a CPQ Contact when completing their Order. These will be linked to the Order once created.
    • Contact – will only prompt the user to create a CPQ Contact, which will be linked to the Order.
    • Account – will only prompt the user to create a CPQ Account, which will be linked to the Order.
    • FALSE – will not prompt the user to create anything when finishing their Order.
  • Account - This can be set to the name of an Account. This will be linked to the Order when it is created.
  • AltAccount - Similar to the above, however the AltAccount value will be stored in the AlternateAccountIdentifier field of an Order instead. This will mainly be used if a 3rd Party Account system is being utilized.
  • Contact - This can be set to the Email Address of a Contact. This will be linked to the Order when it is created.
  • AltContact - Similar to the above, however the AltContact value will be stored in the AlternateContactIndentifier field of an Order instead. This will mainly be used if a 3rd Party Contact system is being utilized.
  • Currency - The name of the currency that you would like the order to be associated with. If this Parameter is not included, the Base Currency will be used by Default.
  • PriceList - The name of the Price List that you would like to use for the Order. Will be applied to all Items added to the Order.
  • WorkflowTransition - The name of the Workflow Transition that you would like run when the user completes their order. If this Parameter is used, it will overwrite any state name set using the State Parameter.

Example Start Parameter:

In order to input multiple parameters into the Start Parameter, you need to follow the syntax style below:

Type=Catalog|Name=Widgets|OrderName=Order123|WorkflowTransition=Completed
        

Make sure you do not put any space between pipe bars (|) or the equals sign (=).

Running an embedded CPQ Order via the Integration Theme

There are a few additional steps that need to be followed in order to run an embedded CPQ Order via the Integration Theme.

  1. Allow access to the Macro named SetMode inside the Project named DriveApp-CPQ-Embed.

    You will need to allow access to any team that will be running the DriveApp.

    <permissions>
    <project name="DriveApp-CPQ-Embed">
    <macro name="SetMode">
           	<team name="Administrators" />
          </macro>	
    </project>
    </permissions>
            
  2. You will then need to add the following after using the runDriveApp() method from the Integration Theme Client SDK.
    await DW_CLIENT.runMacro(<GROUPALIAS>, <DRIVEAPPID>, { macroName: 'SetMode', macroArgument: 'Add' })
            

    Where:

    <GROUPALIAS> is the alias given to your Group in the DriveWorksConfigUser.xml

    <DRIVEAPPID> is the Specification Id given to the DriveApp that is created via the runDriveApp() method.

    This Id can be obtained using the id accessor, see Class Specification - id for more information.

Overwriting Parameters\Setting Parameters using the Integration Theme.

All Parameters can be set during runtime of the Embed DriveApp using the Integration Theme.

The way this is done is by driving a Constant of the same name as the Parameter.

For example: If you wanted to associate the Order with an user that is logged in to your eCommerce platform, you would need to set the AltContact or AltAccount Parameter each time a different user accesses the DriveApp.

This wouldn’t be possible using the Start Parameter, as this is a static value.

The Constant DWConstantAltContact or DWConstantAltAccount can be driven using the standard Integration Theme SDK functions in order to link the eCommerce user with the CPQ Order.

You will need to put the relevant methods for driving the Constants before the runMacro() method explained in step 2 of the Running an embedded CPQ Order via the Integration Theme section above.

Customizing an Embedded Order

The Details (basket) section of an embedded order can be customized using a Project Template.

The Template can be used to customize the User Interface, so that it can be made to fit in with an existing website.

This Template can also be used to link embedded orders with your CRM system, or e-Commerce platform.

CPQ Order Details