Synchronizing Quote Lines
The following chapter gives the procedure to link the Quote and Quote Lines entities within MSCRM. It also gives you the tips and specificities of the synchronization process between both entities.
Configuring the link with Quote Lines
This section is solely to illustrate how to configure a link between an entity and the Quote object and to sync quote lines between CPQ and MSCRM.
QUOTE-QUOTE LINES RELATIONSHIP
The first step to link the Quote and Quote Lines entities is to create a one-to-many relationship between the two entities.
- Go in the Settings > Customization menu in the navigation bar
- Open the “Customize the system” menu
- In the Components > Entities directory, select the Quote entity
- Click on 1:N relationships. Then, click on “New 1-to-many relationship”
- A window pops up to configure the new relationship. Fill the following parameters:
- Click on “Save & Close”
QUOTE LINE SECTION IN THE QUOTE MAIN FORM
Once the link between Quote and Quote Line entities created, you have to personalize the Quote Line section in the Quote Main form.
To know how to add a Quote Line section in the Quote Main form, please refer to the chapter Modifying Parent entities layout.
You can now see the Quote Line section in your Quote Main form.
Once the section is created, you have the possibility to add the Quote Line entity in the Quick Menu of the Quote.
- In the configuration window of the Quote Main Form, click on the Navigation button in the Home tab:
- The list of entities linked to the Quote is displayed in the Relationship Explorer. Double-click on the Quote Line entity
- Save and Publish your modifications
When you are on a Quote entity, you can now access the Quote Line entity via the Quick Menu.
Synchronizing CPQ line items and MSCRM Quote Lines
Quote Lines are a child entity of Quote. Now that the link between them is set, it is possible to create and/or delete and/or update some Quote Lines based on cells of the CPQ Quote spreadsheet, like for any other 2nd level entity described in this document. However, the synchronization process in that case is slightly different. The following chapters describe the architecture of the product catalog in MSCRM and show how to configure the CRM to synchronize CPQ quote line items with Quote Lines and Products entities.
MICROSOFT DYNAMICS CRM PRODUCT CATALOG
MSCRM implements a product catalog that allows users to sell products based on price lists and units of measure. Therefore, one product can be sold at different prices based on its unit of measure and on the price list it belongs to.
The CRM data model of the product catalog is the following:
If a mapping set on Quote Lines is configured as described in the following chapters, the update of the product catalog during the synchronization from CPQ to MSCRM is done as follows:
- In the catalog, only one Unit of measure is used. The synchronization process will create a Unit of measure named “Default unit” if it can’t find one existing.
- As the same product can be sold at different prices - even with the same unit of measure - for different customers or different quotes, the Out synchronization reuses the Price List associated with each Quote.
- The Product is just the item to sell, independently from its price. By default, only its name and reference will be synchronized. It is possible to synchronize additional Product fields – see section Synchronizing CRM Products
- A Price List Item is created to gather all information about a Product, its Unit of Measure and the Price List it belongs to.
MAPPING SET SPECIFICITIES FOR QUOTE LINES AND PRODUCTS
Synchronizing Quote Lines
For each line and/or sub-line of the quote in CPQ, you will be able to create or update Quote Line on the MSCRM side. The lines to take into account for the creation or update of the Quote Lines are identified thanks to a synchronization column. If the line cell for this specific column is not empty (not null), then the CPQ quote line is eligible for the creation or update of the Quote Line entity. The PROS Mapping Set for the Out synchronization allows establishing a correspondance between the line columns and the Quote Line fields.
These fields are mandatory to ensure MSCRM product catalog synchronization:
- Name – The name of the Product
- Product Number – The Product's reference number
- Quantity – The Quantity of the Quote Line
- Amount (Mandatory in some scenarios only) – The Price Per Unit of the Price List Item. If filled, the Amount field is used to map the price per unit coming from CPQ to the CRM Product one. If not filled, then the reference to the CRM Product is done without mapping its price per unit with the one coming from CPQ. In the latter case, the price per unit defined in the CRM for that product - if any - will be used instead.
These fields can be found in the section “Quote Lines Required Fields” of the entity in the mapping Out interface:
Mapping OUT example:
Activation of the Quote sync with the Opportunity
In addition to the CPQ line items sync, an additional feature allows synchronizing CRM Quote Lines with a given Opportunity by leveraging the Opportunity Product entity. For each line and/or sub-line of the Quote synced in the CRM, you can create, update or delete an Opportunity Product.
A Sales rep works mainly on opportunities. A Sales rep can produce several quotes for the same opportunity as variants for the customer. At the end of the day, only a subset of this quote list will reflect the content of the deal, hence the notion of "Active" Quotes for a given Opportunity.
A Quote active for a given Opportunity can have its Quote Line items synchronized with its parent Opportunity. If the Quote is not active for its parent Opportunity, its content will not be synchronized with this Opportunity, whatever the setup done in the PROS Mapping Set and PROS Custom Settings entities.
In details:
- One or several Quotes can be active for their parent Opportunity.
- A Quote can be activated (in the context of its parent Opportunity) by setting the value of the “Active Quote for the Opportunity” flag to "yes" in the Quote Main form.
- The content of the Active Quotes can be synchronized with the Opportunity under the format of Opportunity Products. It is not possible to configure the mapping with Opportunity Products in the PROS Mapping Set. The Opportunity Products are created/updated/deleted based on the mapping defined for Quote Lines entities in the PROS Mapping Set, and on the "Active Quote for the Opportunity” flag in the Quote entity.
- The content of Quotes that are not active is not synchronized with their parent Opportunity entity.
- When a non-active Quote is activated for its Opportunity, a copy is triggered between the Quote Lines entities of the active Quote and the Opportunity Products.
- When an active Quote is deactivated, the deletion of the corresponding Opportunity Products linked to its quote ID is automatically triggered. Its content will no more be synchronized with the Opportunity.
- The synchronized content is refreshed anytime the content of the active Quote changes.
Synchronizing CRM Products
To Synchronize additional Product fields with quote lines values, proceed as follows: In your mapping set, at the Quote Line level, click the “Add Product Attributes” button In the appearing popup, check the fields to sync and match a Product field with a CPQ Quote column.
SYNCING MS DYNAMICS BUNDLES
MSCRM provides an entity to represent product bundles. The sync between CPQ and MSCRM Quote Lines does allow the use of this Bundle entity under certain conditions. This paragraph explains how to procced:
Modeling
- For each Bundle in MSCRM, a Configurable Product must be created in CPQ (relation 1 – 1)
- The synchronization column in CPQ Quote must contain a unique value that clearly identifies the Bundle product in MSCRM (e.g. SyncId1 in the diagram below)
- There is no link or synchronization of sublines, meaning that there is no value to set in CPQ Quote in the synchronization column for sublines
MSCRM Bundle Sync Specificities
- When such a Configurable Product is added in CPQ Quote, its root line and sublines values can be modified (depending on what is authorized in the quote model).
- In the example below, root line price (red) and a subline price (orange) are changed:
- During the sync with MSCRM, depending on the defined Mapping OUT, a Quote Line of the Quote linked to CPQ Quote is created.
- This Quote Line is linked to a Bundle if the CPQ sync column ID matches with a Bundle reference in the CRM
- The values of the Quote Line root line can be overridden because they correspond to the root line in CPQ Quote
- In the example, the Bundle root line price is thus updated in the CRM after a change in CPQ
- But the price of sublines is managed by the CRM. Therefore, any change in CPQ for sublines has no impact in MSCRM.
- The price of SI1 (orange) in the example is not modified despite the change in CPQ
- The price of SI1 (orange) in the example is not modified despite the change in CPQ
- Regarding the policy in the Mapping OUT, only the Basic policy (delete/create of opportunity products) is supported for Bundle Sync
- Regarding the Product policy, only the Reuse policies are supported for Bundle Sync (no product creation during sync)
PRODUCT MANAGEMENT POLICIES
The mapping OUT to create Products complies with a dedicated entity management policy that can be selected in the PROS Custom Settings. From there, you can define a Product Management Policy to use when synchronizing Quote Lines (and product catalog). One of the four following policies can be used.
Products Management Policy rules:
- 1 - Reuse only
Only existing Products (same Product Number) can be used to create Quote Lines. The synchronization process will not create nor modify the MSCRM Product entities. If no corresponding Product is found on the MSCRM side, the Quote Line is not created nor synchronized. If the process finds the product but the Price per unit and/or Name differs, the product is used with its existing value.
- 2 - Allow creation or reuse existing
Either the product already exists on MSCRM side: in that case it is referenced to create the Quote Line. Or the product does not exist and it is created regarding the specific product mapping. As a consequence, the following records are created:
- Unit of measure if none was found
- Product
- Price List if none was associated with the Quote
- Price List Item
As for the previous policy, if the product is found but Price per unit and/or Name differs, the existing values are used.
Once a product exists on the MSCRM side, it cannot be modified by the next synchronization process.
- 3 - Reuse existing and update
Same as 1. In addition, existing products can also be updated following the specific product mapping during the synchronization process. In particular, the process updates the Price per unit and/or Name if it differs from the one currently saved in the Price List Item.
- 4 - Reuse or create if necessary and update
Same as 2. In addition, once a product exists on the MSCRM side it can be updated following the specific product mapping during the synchronization process. In particular, the product updates the Price per unit and/or Name if it differs from the one currently saved in the Price List Item.
Quote Model Specificities
This section lists the specificities of the quote model when used in the context of Quote powered by MSCRM.
- Synchronization action
The synchronization action called when clicking on the “Save” button to trigger the Out synchronization from CPQ to CRM should be similar to the action indicated in the layout.xml and declared in the quote model.
Layout File:
<action actionName="CUSTOM(name=Synchronize)" alignment="left" resourceName="btnClose" translationName="tooltip.Close" url=""/>
Quote model:
The Synchronize action has to be an OnDemand Grid Action, of type CloseSpreadSheet and delegated to the following class:
com.pros.mscrm.services.DelegateCloseSpreadsheetWithRedirectionAction
- Synchronization stateless action
The synchronization action can be set in the PROS Custom Settings. Custom Settings:
Quote model:
The Synchronize action has to be an Automated Action, triggered by a ‘StatelessExecutionMode’ (i.e. the action can be launched when CPQ Web service is launched in silent mode) and of type JavaClass pointing to the following class:
com.pros.mscrm.services.SynchronizeStatelessAction
- Refresh action
The Refresh action, which name is indicated in the PROS Custom Settings, is used when the end-user pushes the ‘Refresh’ button in the Quote form. It allows calling CPQ and re-launch the synchronization from the Quote ‘Main’ form
Quote model:
The Refresh action has to be an Automated Action, triggered by a ‘StatelessExecutionMode’ (i.e. the action can be launched when CPQ Web service is launched in silent mode) and of type JavaClass pointing to the following class:
com.pros.mscrm.services.RefreshStatelessAction
- External ID
The External ID is a field which is present both on CPQ and MSCRM side. It is automatically managed by the integration process. It stores the ID of the Quote when this ID is different than the ID of the MSCRM Quote in order to manage the calls to the CPQ WS.
- Synchronization optimization policy
The more elements are included in the quote, the more synchronizing the quote content with MSCRM takes time. The idea to optimize the sync process is to reduce the size of the quote content out XML flow sent by the CPQ to the CRM.
To reduce the size of this XML flow, a policy mechanism can be configured through the
ContentOutPolicy parameter that can be set as input of the delegate classes responsible for the quote synchronization with the CRM.
This parameter can have several values:
- none: by default, no policy applies on the quote content out and all CPQ elements are sent to the CRM.
- custom: Allows to filter precisely the quote content out XML flow.
By default, if the parameter is not filled, the “none” value is applied.
In the case of a custom policy, the inclusion of the following elements in the XML flow is (de)activable according to a Boolean:
- quoteHeader: inclusion of quote header data
- totalCells: inclusion of quote footer data
- productSublines: inclusion of SI/CP sublines
- quoteLines: inclusion of quote lines (If this parameter is set to false, all the colmuns and sublines policies will be deactivated as well)
By default, if the parameter is not filled, its boolean value will be equal to "true", meaning that the element (quote header, etc.) IS INCLUDED in the XML flow
The following parameter allows to select the quote column(s) to include in the XML flow. All other columns are ignored:
- columnName: the separator used between column names is "~"
By default, if the parameter is not filled, all the columns are included in the XML flow. For instance, the syntax of this policy mechanism can be the following:
- none
- custom;quoteHeader=true;totalCells=true;quoteLines=true;productSublines=true;columnName= ItemQty~ListPrice~TotalListPrice
For instance, an automated action can be configured as follows in the Quote Designer:
The delegate Java classes concerned by this policy mechanism are all the ones linked to CRM actions:
- com.pros.mscrm.services.SynchronizeStatelessAction (via StatelessExecutionMode trigger)
- com.pros.mscrm.services.RefreshStatelessAction (via StatelessExecutionMode trigger)
- Clone Action
The Clone action is used when the end-user pushes the ‘Clone’ button in the Quote Main form. It allows creating a new Quote instance, both on the CRM and CPQ sides. It also duplicates their content and sync them. No setup has to be done in CPQ for this action to be functional.
- Synchronizing Lookup fields
As part of the sync of quote elements from CPQ to MSCRM, it may happen that you have to sync values stored in lookup fields. A lookup field in MSCRM is represented by a list of values, each one associated with a unique identifier (UID). Such a CRM field may be synced with either a field in CPQ or a cell of a quote line in CPQ. The mapping of a lookup field in that context may be defined in the PROS Mapping Set entity.
One characteristic though of MSCRM lookup fields is that, when synced with CPQ, only the UID is sent (mapping IN) or expected (mapping OUT) by the CRM. It implies that a specific mechanism has to be put in place in CPQ to exploit that characteristic. Two use cases can occur: - Either you just need to exploit the lookup UID in CPQ. In that case, a string column/field in CPQ is enough to map
the UID of the lookup field coming from the CRM and/or send it back. - Or you need to manipulate, not only the UID in CPQ, but also the associated description/value from the CRM lookup field in CPQ. In that case, a simple string column is not enough, you need to define a value list in CPQ. A CPQ value list is a concept similar to the CRM lookup field in the sense that it is represented by a table associating a code and a value. A dropdown list selector should be used then for the representation of such a field in the quote UI.
For instance, if you want to sync a list of units of measures between MSCRM and CPQ, you would define a lookup field with UIDs and UoM labels in MSCRM, and a value list with the same code and description in CPQ:
You would then define the mapping of those two elements in the PROS Mapping Set entity.
