Conga Product Documentation

Welcome to the new doc site. Some of your old bookmarks will no longer work. Please use the search bar to find your desired topic.

Show Page Sections

Synchronization

This section gives you the tips and specifics of the synchronization process between MSCRM and CPQ.

information: To perform modifications regarding MSCRM and/or the CPQ managed solution setup, you have to login using a System Administrator profile.

Define Data Mapping Between MSCRM and CPQ

In this section we describe how to set up the way the CRM Quote and CPQ Quote communicate and how to share some custom data depending on your business needs.

Warning: These modifications require knowledge of CPQ model configuration and a basic understanding of MSCRM setup capabilities.

UNDERSTANDING THE SMART CPQ MAPPING SET USE INTERFACE

The Smart CPQ Mapping Set entity is part of the Smart CPQ Configuration app within the Smart CPQ managed solution.

The Smart CPQ Mapping Set is an entity that defines the data that can be exchanged between MSCRM and CPQ. Some mandatory information - system data - is automatically exchanged between the two systems so that they can interact together. However, some additional data can also be declared so that it is sent and leveraged by one system or the other.

The Smart CPQ Mapping Set entity is responsible for the setup of that data mapping.

The entity is linked to the Smart CPQ Setup entity, in the sense that one Smart CPQ Mapping Set can optionally be associated to a Smart CPQ Setup entity.

The Smart CPQ Mapping Set entity is divided in different sections, each accessible via a dedicated tab:

  • General: General information on the Smart CPQ Mapping Set entity.
  • Mapping IN: Data mapping definition for the sync from MSCRM to CPQ.
  • Mapping OUT: Data mapping definition for the sync from CPQ to MSCRM.
  • FetchXML (Extended Mapping IN): Extension of the Mapping IN process allowing leveraging data from any entity of the CRM.

The following section lists the contents of each tab.

Smart CPQ Mapping Set Creation

The creation of a Smart CPQ Mapping Set entity can be done by using the New action in the Smart CPQ Configuration app, as for any entity creation in the CRM.

However, in order to be fully operational, the following steps are required at the time of the creation:

  • Go in the General tab and give the entity a Name (see next paragraph).
  • Navigate to the Mapping In tab.
  • Select the Quote entity in the explorer.
  • click Save.

These two steps can be performed in a different order and along with other actions but they are required for the entity to be created.

General Tab



LABELFUNCTION
NameName of the Smart CPQ Mapping Set instance that serves as reference when leveraged from other entities.

Mapping IN Tab



The Mapping IN tab is divided in two parts:

  • The entity explorer on the left.
  • The entity field selector on the right.

Entity explorer

The entity explorer allows you to navigate through the entity tree you build including all the CRM entities you want to map fields from. Each entity is displayed with its name and the name of the field related to the quote or its parent between parenthesis. Clicking on one given entity displays the list of all its fields in the right part. The Quote entity cannot be removed from the explorer. However, it is possible to add or delete entities in the explorer, down to two levels below the Quote.

Field Selector

The field selector displays the list of fields (label and name) of the entity currently selected in the entity explorer. Each CRM field is associated with an optional text box to link override the name of the CPQ field to be mapped with. If left empty, the standard syntax is used. Clicking on a given field selects it as part of the Mapping IN, meaning its value, if any, will be sent to CPQ. Clicking on a selected field unselects it. A search box allows filtering the list of fields based on the characters you entered. Its role is to ease the selection of fields, specifically for entities containing a lot of them.

The checkbox at the top of the list allows either selecting or unselecting all fields simultaneously. The toggle below the search box allows filtering on either all fields or only the selected ones in the list. It gives a quick overview of all the setup already done for the selected entity.

Save

Saving the Smart CPQ Mapping Set is either a manual action, leveraging the CRM Save button, or an automated one based on the auto-save from the CRM.

Warning: - Save at creation: When creating a Smart CPQ Mapping Set entity, you must give it a name, select the Quote entity in the Mapping IN tab and click Save. Please see the Smart CPQ Mapping Set Creation chapter for more details.

Mapping OUT Tab



The Mapping Out tab is divided in two parts:

  • The entity explorer on the left.
  • The right part containing the entity field selector, as well as the policy selector when relevant.

Entity explorer

The entity explorer allows you to navigate through the entity tree you build including all the CRM entities you want to map fields from. Each entity is displayed with its name and the name of the field related to the quote or its parent between parenthesis. Clicking on one given entity displays the list of all its fields in the right part. The Quote entity cannot be removed from the explorer. However, it is possible to add or delete entities in the explorer, down to two levels below the Quote. The Product

entity and its sub-tree of intermediate entities cannot be removed either from the explorer. However, it is possible to not leveraged them by selecting a None policy in the Policy Selector. Depending on the level of the selected entity in the hierarchy, additional components can be displayed in the right part in addition to the Field Selector.

Field Selector

The field selector displays the list of fields (label and name) of the entity currently selected in the entity explorer. Each CRM field is associated with a text box to link a CPQ field or column to it.

Clicking on a given field selects it as part of the Mapping Out, meaning its value, if any, will be updated based on the CPQ field or column specified in the associated text box. Clicking on a selected field unselects it. A search box allows filtering the list of fields based on the characters you entered. Its role is to ease the selection of fields, specifically for entities containing a lot of them. The checkbox at the top of the list allows either selecting or unselecting all fields simultaneously. The toggle below the search box allows filtering on either all fields or only the selected ones in the list. It gives a quick overview of all the setup already done for the selected entity.

Policy Selector

Depending on the selected entity in the explorer, a policy selector may appear in the right part of the Mapping Out tab. It allows setting up a mapping policy either for Quote Product sync or for Product sync.

Save

Saving the Smart CPQ Mapping Set is either a manual action, leveraging the CRM Save button, or an automated one based on the auto-save from the CRM.

Warning: - Save at creation: When creating a Smart CPQ Mapping Set entity, you must give it a name, select the Quote entity in the Mapping IN tab and click Save. Please see the Smart CPQ Mapping Set Creation chapter for more details.

FetchXML Query Tab



LABELFUNCTION
FetchXML QueriesQueries allowing to retrieve data from any CRM entity and to send that data as part of the Mapping IN.

The behavior and content of each section are described in the next section.

UNDERSTANDING THE COMMUNICATION FROM MSCRM TO CPQ – MAPPING IN

When switching from the CRM Quote to the CPQ Quote, the Mapping IN process gathers data from the CRM Quote, and optionally from other CRM entities (related or not to the Quote), and sends that data to CPQ. This occurs when the quote is created, each time the CPQ is launched (by clicking on a step), when the user "refreshes" the CPQ Quote with the Sync Quote action, etc.

The data sent can come from different sources:

  • System Fields
  • Explicit mapping driven by the Mapping In definition
  • Explicit mapping driven by FetchXML queries

Those elements are described in the next sections.

SYSTEM FIELDS

System fields are mandatory information for the two quotes to sync. They are automatically sent by the CRM and automatically retrieved by CPQ as part of the Mapping IN process. It is thus not necessary to include them in the Mapping IN definition.

The following fields are sent to Smart CPQ as system fields:

KEYDESCRIPTIONNATURETYPEAVAILABLE INEXAMPLE
CRM_QUOTE_IDQuote IDFieldStringQuote module Configurator2bef001d-6b9d-4b59-aabf-063c8893a41a
CRM_GROUPThe position of the user opening the quote (if any)Session variableStringQuote module ConfiguratorSalesperson
Status Reason (statuscode)The status of the quote stored in the Status Reason CRM field in the CRM Quote entity.Option SetStringQuote module ConfiguratorIn Progress

How-to Fill the CRM_GROUP System Field

The CRM_GROUP attribute is retrieved by the CRM from the position of the logged in user. This position has to be understood as a CRM Position entity associated with the logged in user.

The first step thus consists in creating a Position. To do so:

  • Open the setup menu in the top right menu bar and select Advanced Settings.
  • Click on Settings in the navigation bar.
  • Click on Security in the Settings menu.
  • Click on Positions.

You can see the existing positions. Click on the New button to create a new one and then enter a name, a description, and optionally a Parent Position, and Save:



Once the position created, you have to associate it to the corresponding user(s). For that, either you use the '+' button in the right part of the Position entity or you can also:

  • Click on Settings in the navigation bar
  • Click on Security in the Settings menu
  • Click on Users and select the user in the list
  • In the Organization Information section, enter the position for the user


Once done and saved, if the user logs in the CRM, its Position will automatically be transmitted to CPQ in the CRM_GROUP setting.

How-to Update the Quote Status

The update of the Quote status is independent from the Mapping IN definition and from the Sync CPQ action. It is handled by a dedicated CPQ API (Change Business Status). Anytime the Status Reason field is updated in the CRM Quote entity, the API is triggered to update the quote status system field in CPQ (_SYS_STATUS). No mapping definition is necessary for this update to be completed. The update happens without requiring to open Smart CPQ from the CRM. The CPQ system quote status is updated on a change of the CRM Status Reason. Its value is updated, even if the quote is locked. However, if session states are setup in the CPQ model to prevent the update of the _SYS_STATUS field in CPQ, then the CRM cannot update the CPQ quote status.

Warning: You can map the CRM Status Reason field to another CPQ field than the system one. However, it is recommended not to as you could face unexpected behaviors.
information: In order to update the CRM Status Reason from CPQ, you must declare an entry in the mapping OUT section. Please refer to the Mapping OUT chapters to learn more.

For this sync to be successful, you must pay attention to the following aspects:

  • You must remove the Status Reason from the Mapping IN. It is updated with the update quote status API and not with the Sync Quote action.
  • Although the Sync CPQ action also updates the CPQ quote status, it is not mandatory to use it for that purpose.
  • In the CPQ quote model, you must:
    • Define a "Quote Status" field equal to the model.systemField.status. This field is the one that is displayed in the CPQ UI.
    • Set the system status field as user input and associate a domain of value to it with the same values as in the CRM Status Reason.
    • In the Synchronization view used for the Mapping Out, and in the one used for the Doc Gen if different, make sure to send the "Quote Status" field defined above.
    • In the Mapping OUT definition in the Smart CPQ Mapping Set, make sure to

      map _SYS_STATUS (not the "Quote Status" field above) to the CRM Status Reason in the quote section.

    • Only the _SYS_STATUS must be mapped for the quote status. Any copy of it will fail at some point of the workflow.
    • In the scenario where you implement a watermark in a Doc Gen Template, make sure to condition the section where the watermark is displayed to the values of

      the _SYS_STATUS variable. Same thing if you want to display the quote status in the document, use a tag on _SYS_STATUS.

    • As explained above, make sure that no session state in the CPQ quote model prevents the update of the _SYS_STATUS field.

HOW TO MANAGE LOCALES

Locale Types

Two different locales are managed by CPQ:

  • The User Locale, representing the locale of the CPQ user interface.
  • The Data Locale, representing the locale of the quote content.

The user locale is sent from the CRM anytime you open CPQ. It can come from different sources within the CRM.

The data locale is sent to CPQ at quote creation and can be overridden later on from the CRM by leveraging a dedicated mechanism.

The management of these two locales is described in the next paragraphs.

User Locale Management

When you open CPQ from the CRM, the user locale is sent as part of the system fields. The value of the user locale can come from 3 different sources in the CRM:

  • The User Language Override field is part of the managed solution. It can be added to the CRM quote form you are using (Check here how to add a field to a quote form). If done, then you have the opportunity to manually change its value with a locale (for instance, en-US or fr-FR) in the CRM quote before opening CPQ. If filled with a well formatted value, then this value is the one sent to CPQ.
  • In the case where the field above is not set or empty, the system checks if the Locale

    Override setting in the Smart CPQ Settings entity contains a well formatted locale. If so, then

    this value is the one sent to CPQ as the user locale.

  • If both fields above are not filled, the value eventually sent by default to CPQ is the locale of the logged-in CRM user.

Notes:

  • The User Language Override field can be overridden by any user having access to a given quote with sufficient rights. It can thus be different from one user session to the other.
  • The Locale Override setting is defined in the Smart CPQ Settings entity. It means that, when it applies, it applies to all users accessing CPQ.
  • In the case where no time zone can be defined, then UTC is used by default.

Data Locale Management

The data locale is set in CPQ at quote creation. The value of the data locale can come from 2 different sources in the CRM:

  • The Data Locale Override field is part of the managed solution. It can be added to the CRM quote form you are using (Check here how to add a field to a quote form). If done, then you have the opportunity to manually change its value with a locale (for instance, en-US or fr-FR) in the CRM quote before creating the quote in CPQ (via a business rule for instance). If filled with a well formatted value, then this value is the one sent to CPQ.
  • In the case where the field above is not set or is empty, then the system will default the data locale with the user locale. See the previous paragraph to know how the user locale can be set.

If the Data Locale Override field is added to the CRM quote form, then it can be used, not only at quote creation, but also later on to change the data locale in CPQ from the CRM. Anytime the value of the field changes in the Data Locale Override field, a specific plugin is executed in the CRM to set this new value in the _SYS_DATA_LOCALE system variable in CPQ (if permissions defined in the CPQ quote model authorize it). However, if the Data Locale Override field is empty or emptied, then this empty value is not sent to CPQ.

EXPLICIT MAPPING IN

In addition to the system fields automatically sent by the CRM to CPQ, it is possible to explicitly

define the data to retrieve from CRM entities to be sent to CPQ as part of the Mapping IN process. This mapping is explicit in the sense that you will have to finely define which fields from which entities you want to leverage. The definition of that explicit Mapping IN can be done in the Smart CPQ Mapping Set entity, in the Mapping IN tab. The Smart CPQ Mapping Set will then have to be linked to a Smart CPQ Setup entity.

The Mapping IN structure allows you to select:

  • Quote elements to be synced in CPQ
  • Elements from other entities to be synced in CPQ

FIELDS REMOVED FROM ENTITIES

The CRM allows you to add or remove fields from a given entity like the Quote for instance. It may thus happen that a field part of the Smart CPQ Mapping Set is removed from the entity it belonged to. In that case, the following error is displayed when trying to perform the sync with CPQ:



In order to fix that situation, you must refresh the corresponding Smart CPQ Mapping Set entity.

MAPPING IN DEFINITION - QUOTE ELEMENTS

You can select the fields of the CRM Quote entity to be synced to CPQ by clicking on the Quote entity in the explorer:



Selecting a Quote field then just consists in checking its name in the field selector (right part of the screen). By selecting a field, its value - if any - will be sent to CPQ as part of the Mapping IN process.

Note: Some Quote fields (Quote, Name) are pre-selected in the Quote entity and must not be unselected to guarantee the good execution of the Mapping IN process.

CPQ Name (Optional)

By default, CRM names are sent to CPQ with a naming convention imposed by the system (see next paragraph). However, it is possible to override the default syntax by providing a name in the CPQ Name (Optional) column. If set, the value in this column is used.

The naming used in your CPQ quote model must be adapted to match the syntax used in the Mapping IN definition.

information: This column is mainly used for migration from 1.6.X to 1.7+ and ensure backward compatibility when executing the migration process. It is recommended to use the default syntax and let this column empty to guarantee the unicity of the field names.

CPQ Mapping for Quote fields

All the fields from the Quote entity can be retrieved in CPQ by using the following syntax:

  • a "crmquote" prefix
  • a dot '.'
  • the name of the CRM field

For instance, the field "name" of the Quote entity can be retrieved in CPQ with the name "crmquote.name".

Data types

There are 9 data types from the CRM that can be specifically mapped on CPQ types:

CRM DATA TYPECPQ DATA TYPE
StringString
CurrencyMonetary
GUIDString
Decimal NumberBigDecimal
Whole NumberInteger
Date and TimeUTC Date and Time (see details below)
Date and TimeUser Locale Date (see details below)
Date and TimeUTC Date (see details below)
Two OptionsBoolean
Option SetString
Multi Option SetJSON

CRM fields of other types are not supported in the Mapping IN and will not be retrieved by CPQ.

The mapping of Date and Time type of fields from the CRM depends on the CRM format and CRM timezone adjustment selected for their definition.

The Date and Time type in the CRM can be mapped on three different types in the Smart CPQ Mapping Set. In order to differentiate the type you want to use, each Date-and-Time-typed CRM-field is associated with a drop down list in the field explorer of the Smart CPQ Mapping Set, allowing you to choose the corresponding CPQ type you want to leverage:

  • UTC Date and Time: Timestamp including UTC date and time.
  • User Local Date: A CRM field mapped with that type will appear, in the CPQ UI, as a date expressed in the same timezone as the logged-in user.
  • UTC Date: This type returns only the UTC date (no time).

Here is an example illustrating the differences between those date types:

CRM DATA TYPECRM FORMATCRM TIMEZONE ADJUSTMENTMAPPING IN FORMATCPQ DATA TYPECRM UI VALUECRM DATABASE VALUEVALUE SENT TO CPQ
Date and TimeDate and TimeUser LocalUTC Date and TimeDate Time08-21-2023:22:22:33For instance, if user locale is UTC-3: 09-21-2023T01:22:33Z (UTC)For instance, if user locale is UTC-3: 09-21-2023T01:22:33Z (UTC)
UTC DateLocal Date08-21-2023:22:22:33For instance, if user locale is UTC-3: 09-21-2023T01:22:33Z (UTC)For instance, if user locale is UTC-3: 09-21-2023 (UTC)
User Local DateLocal Date08-21-2023:22:22:33For instance, if user locale is UTC-3: 09-21-2023T01:22:33Z (UTC)For instance, if user locale is UTC-3: 08-21-2023 (UTC-3)
Date and TimeDate and TimeTimezone independentUTC Date and TimeDate Time09-21-2023:01:22:3309-21-2023T01:22:33Z (UTC)09-21-2023T01:22:33Z (UTC)
UTC DateLocal Date09-21-2023:01:22:3309-21-2023T01:22:33Z (UTC)09-21-2023 (UTC)
User Local DateLocal Date09-21-2023:01:22:3309-21-2023T01:22:33Z (UTC)09-21-2023 (UTC)
Date and TimeDate OnlyDate OnlyUTC Date and TimeDate Time09-21-202309-21-2023T00:00:00Z (UTC)09-21-2023:00:00:00 (UTC)
UTC DateLocal Date09-21-202309-21-2023T00:00:00Z (UTC)09-21-2023 (UTC)
User Local DateLocal Date09-21-202309-21-2023T00:00:00Z (UTC)09-21-2023 (UTC)

Warning - Missing GUID in lookup fields sync

The sync of lookup (GUID) fields requires to pay attention to the value of the GUID that must be known by the CRM and to the Smart CPQ Mapping Set definition of those fields.

If not properly configured, you may face the following issue during the CPQ sync back:

Cart Sync Exception: {"status":"","error":"Local Sync failed with an exception. Object reference not set to an instance of an object."}

In the case above, the issue comes from the fact that one or several lookup field(s) has been selected in the Mapping OUT section of the Smart CPQ Mapping Set (which is supported by the Smart CPQ Managed Solution), but its value has not been recognized by the CRM.

It could be because:

  • the value is of a wrong type or badly formatted. A GUID is expected for the sync of lookup fields.
  • the GUID does not exist in the CRM.
  • there is no value when one is expected.

To remediate to this issue, you must make sure lookup fields are properly set in CPQ and well configured in the Smart CPQ Mapping Set for both the IN and OUT syncs.

MAPPING IN DEFINITION - ELEMENTS FROM RELATED ENTITIES

In addition to Quote fields, some fields from CRM entities directly or not related to the Quote entity, can also be sent to CPQ as part of the Mapping IN process.

Related entities

Any entity related to the Quote can have attributes gathered and pushed during the Mapping IN process.

We consider that an entity is related to the Quote entity if:

  • a look-up relationship has been defined between the Quote and this entity (1-to-1 relationship). We call this entity a parent entity.
    • For example, in the default managed solution, the Account or the Opportunity are MSCRM entities directly linked to the Quote.
  • the entity is a child of an entity linked to the Quote via a look-up type of relation. We call this entity a 2nd level Entity. Among second level entities, we make a distinction on the type of relationship, whether it is a 1-1 or 1-n relationship:
    • 1-n relationships - e.g. Opportunity Products are children entities of the Opportunity
    • 1-1 relationships - e.g. There is one Contact associated to an Opportunity by default
    • Both are handled as described in the following sections.


Warning: MS Dynamics is driven by Governor Limits. Some may be related to the number of entities that are allowed to be linked together for instance. Please make sure that you respect Microsoft Governor Limits when defining your data mapping to ease the sync between the CRM and CPQ.

Mapping for related entities - Parent Entities

In order to select fields from a parent entity of the Quote, first you must add it in the explorer:

Click on the Quote entity in the explorer and then on Add. A window pops up containing the list of available entities to be added as parent of the Quote. The list contains a column designating the field linking the Quote with its parent entity.

Add a Related Entity X

Filter by name:

1 field selected: Opportunity

Related EntityRelated Field

AccountPotentia I Custom er

AccountPotentia I Custom er

Business UnitOwning Business Unit

Camp.:1ignSource C.:1rnpaign

ContactPotentia I Custom er

CurrencyCurrency

OpportunityLast Opportunity Associated

OpportunityOpportunity

Organizational UnitContracting Unit

OwnerOwner

Price ListPrice List

Process Stage(Deprecated) Stage Id

PROS SetupPROS Setup

Quote LineQuote

SLALast SLA applied

SLASLA

-I Close

Owninn Tf'-Rm

  • Select one or several entities. You can use the search box to filter down the list of entities based on the input characters.
  • Click on Save to add the selected entities to the explorer.

Once a parent entity added to the explorer, adding its fields to the Mapping IN can be done as follows:

  • Click on the parent entity in the explorer. The list of its fields appears in the field selector in the right part of the screen.
  • Select one or more fields.

By selecting a field, its value - if any - will be sent to CPQ as part of the Mapping IN process.

CPQ Mapping for parent entity fields

All the fields from a parent entity of the Quote can be retrieved in CPQ by using the following syntax:

  • the name of the parent entity as prefix.
  • a dot '.'
  • the name of the related field of the parent entity.
  • a dot '.'
  • the name of the CRM field.

For instance, the field "name" of the Account (Potential Customer) entity can be retrieved in CPQ with the name "account.msdyn_Account.name".

Data Types

Supported data types in the Mapping IN for parent entities are the same than for the Quote entity.

Mapping for related entities - 2nd Level Entities

In order to select fields from a 2nd level entity, first you must add it in the explorer:

  • First add its parent entity to the Quote (See the previous chapter).
  • Once done, select its parent entity in the explorer and click on Add. A window pops up containing the list of available entities to be added as children of the selected parent entity. The list contains a column designating the field linking the 2nd level entity with its parent.
  • Select one or several entities. You can use the search box to filter down the list of entities based on the input characters.
  • Click on Save to add the selected entities to the explorer.
    Important: As part of the Mapping IN, the various fields of a given instance of 2nd Level entity can only be mapped on CPQ fields. On the contrary of the Mapping OUT, the Mapping IN does not allow syncing a 2nd level entity instance with a given CPQ Quote Line.

Once a 2nd level entity added to the explorer, adding its fields to the Mapping IN can be done as follows:

  • Click on the 2nd level entity in the explorer. The list of its fields appears in the field selector in the right part of the screen.
  • Select one or more fields.

By selecting a field, its value - if any - will be sent to CPQ as part of the Mapping IN process for all the instances of that 2nd level entity associated with its parent entity.

For instance, if 3 Contacts are associated with the Account (Potential Customer) linked to the Quote, and if their first name is part of the fields selected in the Mapping IN definition, then the first name of each one of the 3 Contacts will be sent to CPQ as part of the Mapping IN.

CPQ Mapping for 2nd level entity fields

All the fields from a 2nd level entity can be retrieved in CPQ by using the following syntax:

  • the name of the parent entity as prefix.
  • a dot '.'
  • the name of the related field of the parent entity.
  • a dot '.'
  • the name of the 2nd level entity.
  • a number between brackets corresponding to the number of the instance of the second level entity.
  • a dot '.'
  • the name of the related field of the 2nd level entity.
  • a dot '.'
  • the name of the CRM field.

For instance, the field "firstname" of the #1 Contact (Company Name) of the Account (Potential Customer) linked to the Quote can be retrieved in CPQ with the name "account.msdyn_Account.contact[1].company.firstname".

Data Types

Supported data types in the Mapping IN for 2nd Level entities are the same than for the Quote entity.

FETCHXML QUERIES

As described in the previous chapters, the Mapping IN structure allows sending to CPQ data coming from the Quote entity, Quote parent entities and children of the Quote parent entities (2nd level entities).

However, when setting up the Mapping IN, it could occur that you need to access fields from CRM entities at deeper levels or to leverage several instances of the same entity during the Quote sync (several Contacts of the Account linked to the Quote for instance). For that use case, the Smart CPQ Mapping Set entity provides a FetchXML query mechanism to retrieve data from virtually any entity in the CRM.

information: The number of queries is not limited in the managed solution. The execution of the query itself comes with good performances. The only limitation when it comes to defining a lot of complex queries would be on the volume of the structure of the response to those queries: the more elements you get back from the query, the longer the opening of CPQ Quote will take.

The name of the query should be made of letters and / or numbers. Special characters are not allowed.

You can write queries directly in the text field of the Smart CPQ Mapping Set. However, it is recommended to leverage an external editor - like the XRM toolbox and fetch XML builder plugin provided by Microsoft – and then to copy/paste the query in the Smart CPQ Mapping Set text field.

Query example to retrieve the name and last name of all the Contacts associated to the Account specified in the Quote:



The outcome of those queries is a JSON structure that is automatically integrated in the CRM Context sent to CPQ as part of the Mapping IN mechanism.

Here is an example of the format of the answer:

Answer to FetchXML Query

{

"quoteId":null,

"modelName":"DynamicsCrmSandboxModel",

"dataProviderName":"MscrmContext",

"context":

[

{"key":"account.accountguid","value":{"valueType":"String","value":"77d772f9-7453-ea11-a812-000d3a5466d8"}},

{"key":"crmquote.name","value":{"valueType":"String","value":"Demo Quote"}},

{"key":"account.name","value":{"valueType":"String","value":"Conga"}},

{"key":"crmquote.quotenumber","value":{"valueType":"String","value":"QUO-01040-D5R1T1"}},

{"key":"quote.currencysymbol","value":{"valueType":"String","value":"USD"}},

{"key":"contactAccountQuery.account[1].createdon","value":{"valueType":"DateTime","va lue":1582157256000}},

{"key":"contactAccountQuery.account[1].contact.firstname","value":{"valueType":"Strin g","value":"USD"}},

{"key":"contactAccountQuery.account[1].name","value":{"valueType":"String","value":"C onga"}},

{"key":"contactAccountQuery.account[1].transactioncurrencyid","value":{"valueType":"S tring","value":"7fd7b299-734a-ea11-a815-000d3a4df23f"}}

]

}

CPQ Mapping for 2nd level entity fields

In the answer, you will find a structure like "key":"contactAccountQuery.account[1].createdon". This key structure is defined as queryName.entityLogicalName.[record#].recordField.

As a designer of the CPQ Quote model, you have to make sure that the elements from the response you want to leverage are correctly mapped on CPQ fields

Quote Alias in FetchXML Queries

When writing FetchXML queries that will retrieve information from entities linked to a Quote, you can specify a tag that the CRM will replace automatically by the corresponding Quote ID.

Here is an example of alias that you can use (QUOTEID):

Quote Alias Example

<fetch top="2" >

<entity name="account" >

<attribute name="name" />

<attribute name="accountnumber" />

<link-entity

name="contact" from="parentcustomerid" to="accountid" alias="contact" >

<attribute name="lastname" />

</link-entity>

<link-entity name="opportunity" from="customerid" to="accountid" >

<attribute name="name" />

<link-entity name="quote" from="opportunityid" to="opportunityid" >

<filter>

<condition attribute="quoteid" operator="eq" value="{QUOTEID}" />

</filter>

</link-entity>

</link-entity>

</entity>

</fetch>

Create Domain From Context

In Smart CPQ, it is possible to dynamically define the domain of value of a given cell in the quote model. One way of defining such domain is to base it on list of values sent by the CRM to CPQ as part of the CRM context.

Those list of values can come either from:

  • Multi-selection fields from the CRM
  • Lists of 2nd level entities (e.g. the list of contacts for a given account linked to the quote)
  • Lists coming from the outcome of a fetchXML query

    See the following page to learn more about Dynamic Domains in Smart CPQ.

    Due to Smart CPQ Governor Limits, the domain will not be generated if it exceeds the maximum number of values allowed.

Multi-selection field

The Multi Option Set fields in the CRM have to be used for that purpose. Each value of a multi-option set field has:

  • a localized label (string value)
  • a code (long integer value)

When added to the Mapping In section of the Smart CPQ Mapping Set, a field of that type is sent to CPQ in a JSON format within the CRM context.

Each value of this multiple value JSON is sent in String format. Here is an example of the JSON format sent:

{ "Delivery": {
"multiple": [
{
"string": "Truck"
},
{
"string": "Boat"
},
{
"string": "Train"
}
]
},
}

The corresponding JSON structure must be retrieved in Smart CPQ with an EXECUTEJSONPATH type of action.

The domain of value should be modeled based on this JSON.



2nd Level Entities

The creation of a domain from a JSON object is natively supported.

Example

In this example, we try to send the list of contacts of an account linked to the quote in the CRM.

  1. In the Quote Designer for Smart CPQ, create a field and define its Domain as follows:
$.['account.customerid'].['contact.parentcustomerid'][*].['fullname']
  1. In the CRM, navigate to the Smart CPQ Mapping Set in the Smart CPQ Configuration App. In the Mapping In section, add the Account and Contact tables to the mapping:


  1. Now open a Quote in the CRM and select the associated Account. Add several Contacts to it:


  1. Navigate to the Quote in the CRM and switch to Smart CPQ. Here is an example of what is
    sent part of the mapping In::

Mapping IN JSON

  1. In the quote interface in Smart CPQ, for the field you created, you should see:

FetchXML queries:

The answer to FetchXML queries is also compatible with this approach and can be used to define a domain of value for a CPQ field.

Two formats are supported for the outcome of FetchXML queries::

Compact Format: each new query is in compact format by default. This format of the response to queries is a more condensed JSON structure part of the CRM context. It represents lists of entity attributes in a JSON list gathering all instances involved.

Non-compact format: this format is deprecated. It is the historical format of FetchXML queries. It represents lists of entity attributes individually for each instance involved.

There is no way to switch from a query in compact format to a non-compact format.

If you switch from a non-compact format to a compact format for a given query, you cannot revert it back. It implies that you will have to adapt the mapping of the outcome of the query in Smart CPQ.

Example

The following query returns the Contacts full names for a given Account associated with the Quote:

See the FetchXML query content

In non-compact format, the contacts will appear in the CRM context as follows::

This format forces you to know the list to map those answers on CPQ fields (See FetchXML chapter above for more details).

This cannot be used to create a domain of value for a given CPQ field.

In compact format, the same contacts are returned under the form of a list:

It is thus possible, in the Quote Designer, to parse the list using a [*] (wildcard) character to build the domain of value.

UNDERSTANDING THE COMMUNICATION FROM CPQ TO MSCRM – MAPPING OUT

When switching from the CPQ Quote to the CRM Quote, the Mapping OUT process gathers data from the CPQ Quote. That data is then pulled by the CRM to update the CRM Quote and optionally some other CRM entities directly related or not to the Quote. This occurs whenever the CPQ Quote is saved and synced, when you refresh the CPQ Quote with the Sync Quote action, etc.

The sync action called when clicking on Close Cart & Sync is part of the Smart CPQ managed solution. At the end of the sync process, you are redirected to the CRM Quote automatically.

The data sent from CPQ can include Quote Fields and Quote Lines that are listed in a dedicated Mapping OUT definition in the Smart CPQ Mapping Set entity and linked to the Smart CPQ setup.

The mapping OUT process handles both the CPQ Quote fields and CPQ Quote lines sync. Several elements can be part of the data synced back to the CRM from CPQ:

  • CPQ elements to be synced with the CRM Quote.
  • CPQ elements to be synced with CRM entities related to the Quote.
  • CPQ Quote Lines Sync: this specific use case is addressed in the Synchronizing CPQ Quote Lines chapter.
  • CPQ Quote Line items to be synced with CRM Product entities: this specific use case is addressed in the Manage CRM Products chapter.

Fields removed from entities

The CRM allows you to add or remove fields from a given entity like the Quote for instance. It may

thus happen that a field part of the Smart CPQ Mapping Set is removed from the entity it belonged to. In that case, the following error is displayed when trying to perform the sync with CPQ:



In order to fix that situation, you must refresh the corresponding Smart CPQ Mapping Set entity.

MAPPING OUT DEFINITION - QUOTE ELEMENTS

You can select the fields of the CRM Quote entity to be updated from CPQ fields by clicking on the Quote entity in the explorer:



Selecting a Quote field then just consists in checking its name in the CRM Name column of the field selector (right part of the screen). You must then associate the name of a CPQ field in the text box of the CPQ Name column. By selecting a field and associating it to a CPQ field, its value - if any - will be synced and updated as part of the Mapping OUT process.

System fields

While the Mapping OUT structure is pretty open when it comes to the definition of the quote elements to map between MSCRM and CPQ, some information must be sent to the CRM for the overall Mapping OUT process to be successful. Those system fields can be seen as technical mandatory fields of the Quote entity. Those fields (Quote ID and Name) are pre-selected in the CRM Quote entity and must not be unselected to guarantee the good execution of the Mapping OUT process.

CRM DISPLAY NAMECRM NAMECPQ NAMEDESCRIPTIONNATUREEXAMPLES
Quote IDquotenumbercrmquote.quotenumberQuote IDSingle line of text2bef001d-6b9d-4b59-aabf-063c8893a41a
Namenamecrmquote.nameQuote NameSingle line of textMy Quote

Data types

There are 10 data types from CPQ that can be specifically mapped on CRM types:

CPQ DATA TYPECRM DATA TYPE
StringString
MonetaryCurrency
BigDecimalDecimal Number
IntegerWhole Number
BusinessString
CurrencyString
Date TimeDate and Time (see details below)
Local DateDate and Time (see details below)
BooleanTwo Options
StringOption Set
StringLookup
CurrencyPerQuantityValueString
MonetaryPerQuantityValueString
MeasureValueString

CPQ fields of other types are not supported in the Mapping OUT and will not be retrieved by the CRM.

Note: the Date Time Behavior of this table column must be set to User Local in the CRM

The mapping of date fields from CPQ depends on their type in CPQ and on the definition of the Date-and-Time type of CRM fields on which they are mapped.

In Smart CPQ, date fields can be of two types:

  • Date Time: contains a date and a timestamp.
  • Local Date: Contains a date only.

In the CRM, the definition of a Date and Time field also depends on the format and timezone adjustment selected for their definition.

Here is the date fields definition that you must apply for the mapping out to execute the expected behavior:

CPQ DATA TYPECRM DATA TYPECRM FORMATCRM TIMEZONE ADJUSTMENTCPQ VALUE SENT TO CRMCRM UI VALUECRM DATABASE VALUE
Date TimeDate and TimeDate and TimeUser Local08-21-2023:22:22:3308-21-2023:22:22:33For instance, if user locale is UTC-3: 09-21-2023T01:22:33Z (UTC)
Date TimeDate and TimeDate and TimeTimezone independent09-21-2023:01:22:3309-21-2023:01:22:3309-21-2023T01:22:33Z (UTC)
Local DateDate and TimeDate OnlyDate Only09-21-202309-21-202309-21-2023T00:00:00Z (UTC)

Warning - Missing GUID in lookup fields sync

The sync of lookup (GUID) fields requires to pay attention to the value of the GUID that must be known by the CRM and to the Smart CPQ Mapping Set definition of those fields.

If not properly configured, you may face the following issue during the CPQ sync back:

Cart Sync Exception: {"status":"","error":"Local Sync failed with an exception. Object reference not set to an instance of an object."}

In the case above, the issue comes from the fact that one or several lookup field(s) has been selected in the Mapping OUT section of the Smart CPQ Mapping Set (which is supported by the Smart CPQ Managed Solution), but its value has not been recognized by the CRM.

It could be because:

  • the value is of a wrong type or badly formatted. A GUID is expected for the sync of lookup fields.
  • the GUID does not exist in the CRM.
  • there is no value when one is expected.

To remediate to this issue, you must make sure lookup fields are properly set in CPQ and well configured in the Smart CPQ Mapping Set for both the IN and OUT syncs.

Example of Lookup and Option Set Sync

This section gives you an example of the setup required to properly sync lookup fields and option sets:

  • In the CRM, you must declare fields of lookup / option set type. It could be in the Quote table or in any table managed by the Smart CPQ Mapping Set.

For instance, at the Quote Product level:



  • In the CPQ quote model, you must declare a field (for a CRM Quote or a 1st level entity field mapping) or a column (for a 2nd level entity field mapping) of type String (for the lookup / option set) or with a domain of value (for the option set only).
    • The lookup field must contain a GUID that is known by the CRM. In order to be sure that this is the case, it is recommended to pass this GUID in a String field / column of CPQ as part of the Mapping IN.
    • The Option Set field can contain either a value of a domain or a string. Both must match a value of the Option Set field defined in the CRM.
  • Lastly, you have to make sure the CPQ fields / columns are properly mapped on the CRM fields in the Smart CPQ Mapping Set.

In the above example, in the Mapping OUT section of the Smart CPQ Mapping Set for Quote Products:



MAPPING OUT DEFINITION - RELATED ENTITIES:

Any entity related to the Quote can have attributes gathered and pulled during the Mapping OUT process.

We consider that an entity is related to the Quote entity if:

  • a look-up relationship has been defined between the Quote and this entity (1-to-1 relationship). We call this entity a parent Entity.
    • For example, in the default managed solution, the Account or the Opportunity are MSCRM entities directly linked to the Quote.
  • the entity is a child of an entity linked to the Quote via a look-up type of relation. We call this entity a 2nd level Entity]. Among second level entities, we make a distinction on the type of relationship, whether it is a 1-1 or 1-n relationship.
    • 1-n relationships - e.g. Opportunity Products are children entities of the Opportunity.
    • 1-1 relationships - e.g. There is one Contact associated to an Opportunity by default.
    • Both are handled as described in the following chapters. See the Synchronize CPQ Quote Lines chapter for more details.


Warning: MS Dynamics is driven by Governor Limits. Some may be related to the number of entities that are allowed to be linked together for instance. Please make sure that you respect Microsoft Governor Limits when defining your data mapping to ease the sync between the CRM and CPQ.

Mapping structure for related entities - Parent Entities

In order to select fields from a parent entity of the Quote, first you must add it in the explorer:

  • Click on the Quote entity in the explorer and then on Add. A window pops up containing the list of available entities to be added as parent of the Quote. The list contains a column designating the field linking the Quote with its parent entity.
  • Select one or several entities. You can use the search box to filter down the list of entities based on the input characters.
  • Click on Save to add the selected entities to the explorer.

Once a parent entity is added to the explorer, adding its fields to the Mapping OUT can be done as follows:

  • Click on the parent entity in the explorer. The list of its fields appears in the field selector in the right part of the screen.
  • Select one or more fields in the CRM Name column.
  • Associate the name of a CPQ field in the text box of the CPQ Name column.

By selecting a field and associating it to a CPQ field, its value - if any - will be synced and updated as part of the Mapping OUT process.

Data Types

Supported data types in the Mapping OUT for parent entities are the same than for the Quote entity.

Mapping for related entities - 2nd Level Entities

The mapping OUT definition for this type of entities is given in the following chapter: Synchronize CPQ Quote Lines. It includes the mapping on CRM Quote Products.

MAPPING OUT DEFINITION - CRM PRODUCT ENTITIES

The mapping OUT definition for CRM Product entities is given in chapter: Manage CRM Products.

Synchronize CPQ Quote Lines

CRM Quote Products are a child entity of the CRM Quote representing CPQ Quote Lines. While the relationship between these entities is a 1-n relationship, it is possible to update some CRM Quote Products based on cells of the CPQ Quote spreadsheet. However, the synchronization process in that case is slightly different. The following chapters describe how to configure the CRM to synchronize CPQ Quote Lines with Quote Products entities.

While the sync between CPQ Quote Lines and CRM Quote Details has been simplified in the mapping OUT definition, it is also possible to sync elements from CPQ Quote Lines with any 2nd level entity of the CRM (see Define Data Mapping between MSCRM and CPQ for more details on 2nd level entities).

Note: You must choose one of the sync mechanisms available to handle quote lines sync depending on the volume of quote lines you have to manipulate.

Information: Sync Hierarchy

MSCRM does not support by default hierarchies of products in the Quote entity. CPQ provides some ways to workaround that CRM limitation:

  • The Smart CPQ solution provides Parent Row ID of each quote product that is synced so you can rebuild the hierarchy via a customization. Note that during the sync from CPQ, CPQ Folders are considered as any other CRM quote lines.
  • The Smart CPQ solution also sets a sequence number on each CRM quote product at the time of the sync corresponding to the order of the corresponding lines in Smart CPQ. Sorting quote products in the CRM based on that number allows to reproduce the CPQ quote line order.

These two fields are described in this page.

Synchronize SPECIFIC Lines

SPECIFIC products in Smart CPQ are a way for you to manually define quote lines that are not

direct references to products in your portfolio. The Smart CPQ managed solution now allows you to sync those SPECIFIC products as write-in products in the CRM.

QUOTE LINES MAPPING OUT

As described in the chapter Define Data Mapping between MSCRM and CPQ, the sync of CPQ elements in the CRM is driven by a JSON structure - the Mapping OUT structure - stored in the Smart CPQ Mapping Set entity (linked to a Smart CPQ Setup entity) of the managed solution.

Two ways are possible for the mapping of CPQ Quote Lines:

  • Define the mapping with any 2nd level entity related to the Quote.
  • Use a simplified mapping with the Quote Products entity of the CRM.

Both are described in the following chapters.

Mapping Structure for 2nd Level Entities



In order to select fields from a 2nd level entity, first you must add it in the explorer (left part):

  • First add its parent entity to the Quote. See Define Data Mapping between MSCRM and CPQ.
  • Once done, select its parent entity in the explorer and click on Add. A window pops up containing the list of available entities to be added as children of the selected parent entity. The list contains

    a column designating the field linking the 2nd level entity with its parent.

  • Select one or several entities. You can use the search box to filter down the list of entities based on the input characters.
  • Click on Save to add the selected entities to the explorer.
    Important: On the contrary of the Mapping IN, the Mapping OUT allows creating/updating/deleting an instance of a 2nd level entity based on a synced CPQ Quote Line. It does not allow to sync elements of a given CPQ Quote Line with fields of the Quote or its parent entities listed in the Smart CPQ Mapping Set.

Once a 2nd level entity added to the explorer, adding its fields to the Mapping OUT can be done as follows:

  • Click on the 2nd level entity in the explorer. The list of its fields appears in the field selector in the right part of the screen.
  • Select one or more fields in the CRM Name column.
  • Associate the name of a CPQ column in the text box of the CPQ Name column.

By selecting a field and associating it to a CPQ column, its value - if any - will be synced as part of the Mapping OUT process for all eligible CPQ Quote Lines.

Data Types

Supported data types in the Mapping OUT for parent entities are the same as for the Quote entity.

Mapping Policies and Sync Column for 2nd Level Entities



It is possible to create and/or delete and/or update some 2nd level entities based on cells of the CPQ Quote Lines.

For each line and/or sub-line of the quote in CPQ, you can create or update a 2nd level Entity on the

MSCRM side.

The lines to take into account for the creation or update of the entities 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 MSCRM entity The mapping OUT allows establishing a matching between the line columns and the 2nd level entity fields.

The mapping OUT:

  • Indicates the type of entities to be generated.
  • Specifies, for each entity, the synchronization column allowing to identify/select which quote lines are used to update/create/delete the entities.
  • Is driven by the entity management policy.
  • Maps the entity fields with quote line cells
    Note: Opportunity Products as 2nd level entities - As Opportunity Products can be created or updated via the Primary Quote feature, their mapping cannot be defined as a 2nd level entity part of the Mapping OUT.

    CRM Sync Column The CRM Sync column must be filled with the name of a CRM field available in the field selector.

    The corresponding field in the field selector must be associated with a column of a CPQ Quote Line. This CPQ column is then used by the various mapping policies described in the next paragraph.

    For instance:



    In the above example, the CPQ column "UniqueContactID" that is mapped on the "Contact" field of the 2nd level entity that is selected, is the one used to rule the sync. The CPQ column is thus associated with the "contact" field in the field selector and this "contact" field is the one defined as the CRM Sync Column.

Entity Management Policy Rules



The sync of CPQ Quote Lines with 2nd level entities is also driven by a dedicated mapping policy:

  • Basic policy - when the Quote synchronization process is launched, all the 2nd level entities linked to the parent entity are deleted. Then brand new entities (one per quote line identified by a non-empty value in the quote synchronization column) are created following the mapping OUT

    structure in the Smart CPQ Mapping Set.

  • Advanced policy - when the Quote synchronization process is launched, for each line of the quote (identified by a non-empty value in the quote synchronization column), the process compares the value of this cell with the synchronization ID stored in the already existing 2nd level entities:
    • If an already existing entity having the same synchronization ID is found, then this entity is updated.
    • If no existing entity with the same synchronization ID is found, then a new entity identified by the synchronization ID is created
    • Other entities stay attached to the parent entity
  • Advanced-del policy - when the Quote synchronization process is launched, for each line of the quote (identified by a non-empty value in the quote synchronization column), the process compares the value of this cell with the synchronization ID stored in the already existing 2nd level entities:
    • If an already existing entity having the same synchronization ID is found, then this entity is updated.
    • If no existing entity with the same synchronization ID is found, then a new entity identified by the synchronization ID is created
    • Other entities attached to the parent entity are deleted.
      Warning: - Default Policy: If the mapping is defined without setting any policy, then the basic policy is applied by default when performing the sync.

Mapping for Quote Products Entity

Fields

Quote Products is the entity representing Quote Lines in the CRM. Quote Details is a direct child entity from the Quote. It is thus not precisely a 2nd level entity. However, the mapping of CPQ Quote Lines on CRM Quote Details is very close to the mapping of 2nd level entities described in the previous chapter.

In order to select fields from the Quote Details entity, first you must add it in the explorer (left part):

  • Click on the Quote entity in the explorer and then on Add. A window pops up containing the list of

    available entities to be added as parent of the Quote, plus an entity named Quote Product.



  • Select the Quote Product entity by clicking on its name. You can use the search box to filter down the list of entities based on the input characters.
  • Click on Save to add the selected entity to the explorer.

The entity appears below the Quote.

Once the Quote Product entity added to the explorer, adding its fields to the Mapping OUT can be done as follows:

  • Click on the Quote Product entity in the explorer. The list of its fields appears in the field selector in the right part of the screen.
  • Select one or more fields in the CRM Name column.
  • Associate the name of a CPQ column in the text box of the CPQ Name column.

By selecting a field and associating it to a CPQ column, its value - if any - will be synced as part of the Mapping OUT process for all eligible CPQ Quote Lines.

System Fields

In addition to the fields that can be manually selected above, system fields are sent or set by default by CPQ when syncing CPQ Quote Lines with Quote Products entities:

CRM DISPLAY NAMEDESCRIPTIONCRM NAMETYPEEXAMPLE
Smart CPQ Line Template TypeType of CPQ line (product, folder, bundle, etc.) synced in the CRM.prosqtx_line_template_typeSingle Line of TextPRODUCT
Smart CPQ Row IDIdentifier of the corresponding row in the CPQ Quote. You must map the rowId field on a CRM string field of your choice to be able to leverage it. For instance ( Product Number is a String here):prosqtx_rowidSingle Line of Text9802
Parent Row ID Warning: This field cannot be selected in the Smart CPQ Mapping Set.prosqtx_parent_row_idLookup
Sequence NumberThis field is set by the managed solution during the quote content sync from Smart CPQ. It applies whether you leverage the plugin sync or the Azure function sync. During the sync, based on the CPQ quote export performed during the sync, the sequence number is set starting at 1 and following the same order as in the CPQ quote (1, 2, 3, etc.). Sorting the CRM Quote Product view in the CRM based on that sequence number thus allows you to sort the corresponding lines exactly as they are sorted in the sync view in Smart CPQ. It includes all types of CPQ quote lines, including folders, configurable products or bundles for instance. Warning: This sequence number applies to all sync policies available (see above). Note that in the case of the second policy ( advanced ), no lines in the CRM are deleted when the corresponding CPQ quote lines are. Therefore, the sequence number for deleted lines in that specific scenario are set to -1 to not disrupt the CPQ quote line order. This exception does not impact the other policies ( basic / advanced-del ).prosqtx_sequencenumberWhole number1

Quote Products Update Policy



When the Quote Products entity is declared in the Mapping OUT as described above, it means that the creation, update and deletion of those entities are ruled by the same mapping policies than second level entities:

  • Basic
  • Advanced
  • Advanced-del

The lines to take into account for the creation or update of the entities are identified thanks to a synchronization column. If the line cell for this specific column is not empty (not null), then the

Quote Product is eligible for the creation or update of the MSCRM entity. The Mapping OUT allows establishing a matching between the cells and the 2nd level entity fields. Please see Entity Management Policy rules for more details.

Note: If you are using the standard plugin sync, the three policies (basic, advanced, advanced-del) are available for Quote Product sync. However, if the sync leveraging Azure Functions is activated, then only the advanced-del policy is applied by default.
Warning: - Default Policy: If the mapping is defined without setting any policy, then the basic policy is applied by default when performing the sync.

Dual-Write Support

Dual-write is an out-of-box infrastructure that provides near-real-time interaction between customer engagement apps and Finance and Operations apps. When data about customers, products, people, and operations flows beyond application boundaries, all departments in an organization are empowered. Dual-write provides tightly coupled, bidirectional integration between Finance and Operations apps and Dataverse. Any data change in Finance and Operations apps causes writes to Dataverse, and any data change in Dataverse causes writes to Finance and Operations apps. This automated data flow provides an integrated user experience across the apps.

If you have Dual-Write enabled, then an additional setup must be done in the Smart CPQ Mapping Set for the Mapping Out of quote lines. In details, the Sequence Number of the CRM Quote Product entity must be mapped on a column returning a unique ID for each line. The rowid system column is recommended to be used for that purpose:



Manage CRM Products

When synced with Quote Products CRM entity, CPQ Quote Lines are, by default, created as write-in products in the CRM. Now the Smart CPQ managed solution also allows linking the CPQ Quote Lines with CRM Product entities to leverage the product catalog capabilities of the CRM. This specific sync mechanism depends on dedicated sync policies as described in this section.

MICROSOFT DYNAMICS CRM PRODUCT CATALOG

MSCRM implements a product catalog that allows you 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:



The above diagram shows the link between the products entities updated from CPQ (e.g. Opportunity Products or Quote Products) and the CRM Product entity. It highlights the fact that syncing CRM Products from CRM Opportunity Products for instance may require the creation or update intermediates entities:

  • Price List Item
  • Price List
  • Unit Of Measure

As an admin, you should specify the mapping for the required fields of Products entity and intermediate entities (Price List, Price List Item, Unit of Measure) through the JSON Mapping OUT

structure detailed in the next chapter.

MAPPING CRM PRODUCTS

As described in the chapter Define Data Mapping between MSCRM and CPQ, the sync of CPQ elements into the CRM is driven by a JSON structure - the Mapping OUT structure - stored in the Smart CPQ Mapping Set entity (linked to a Smart CPQ Setup entity) of the managed solution.



A dedicated section is available in the explorer of the Mapping OUT tab to handle the sync of Products and intermediate entities. When selecting the Product entity in the explorer by clicking on it, the selection of a mapping policy is displayed in the right part of the screen. When the selection is set to None, no policy is selected and no sync with CRM Product entities is performed as part of the mapping OUT.



If you select a policy other than None, the list of fields of the CRM Product entity is displayed in the right part.

Adding CRM Product fields to the Mapping OUT can be done as follows:

  • Select one or more fields in the CRM Name column.
  • Associate the name of a CPQ column in the text box of the CPQ Name column.

The following fields are required:

  • Product ID
  • Name
  • Decimals Supported

A value must be set in the CPQ Name column for those required fields. An error message is displayed while they are not configured.



If you select a policy other than None, two fields are displayed in the Product Mapping Policies section in the right part:

CRM Sync Column

  • CPQ Sync Column

By default, the sync of CPQ quote lines with CRM Products is based on the product name, meaning on the CRM Name field in the right part. It implies that it relies on the CPQ column name that you set in the Mapping Set for the Name field.

If you want to use a different CRM column for the sync, you can leverage the CRM Sync Column and associate a CPQ Sync Column directly in the Product Mapping Policies section.

If they are both empty, the default behavior applies. If the CRM Sync Column only is empty, then the default value (product name) is used.

MAPPING POLICIES FOR PRODUCTS

Four policies are available from the Product entry in the explorer, depending on the level of update of CRM Products you want to setup.



Note: Selecting a policy is optional - if None is selected, then no CRM Product sync is performed as part of the sync back from CPQ.

Reuse Only

Only existing Products can be used to create Quote Products or 2nd level entities. The synchronization process will not create nor modify the CRM Product entities. If no corresponding Product is found on the MSCRM side, the Quote Products/2nd level entity 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. Custom Unit Groups in the CRM Product entity cannot be used, only the default one is used.

Allow Creation or Reuse Existing

Either the product already exists on the MSCRM side: in that case it is referenced to create the Quote Products / 2nd level entity. Or the product does not exist and the sync process then tries to create it when allowed in the following scenario:

  • If all intermediate entities exist, then the process go to the next step. If a given intermediate entity is not found but the corresponding Allow Creation flag is checked, then the intermediate entity is created and the process continues. If however the Allow Creation flag is not checked, then the intermediate entity cannot be created and the process stops, thus preventing the creation of the

    CRM Product and the CPQ Quote Line sync. See the Mapping of intermediate entities below for more details on the Allow Creation flag.

  • If the Product is found, then it is reused and the corresponding Quote Products / 2nd level entity can be created and synced. If the Product is not found, then it is created and the corresponding Quote Products / 2nd level entity can be created and synced.

As for the previous policy, if the product is found but Price per unit and/or Name differs, the existing values are used. Custom Unit Groups in the CRM Product entity cannot be used, only the default one is used. Once a product exists on the MSCRM side, it cannot be modified by the next synchronization process.

Reuse Existing and Update

Same as Reuse Only. 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.

Reuse or Create if Necessary and Update

Same as Allow Creation or reuse existing. 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.

MAPPING INTERMEDIATE ENTITIES

Synchronizing CPQ Quote Lines with CRM Products requires to setup the mapping of mandatory fields part of the intermediate entities. The corresponding mapping of intermediate entities is accessible under the Product entity in the explorer of the Mapping OUT tab. The intermediate entities are available only if a mapping policy different than None has been chosen at the Product level. If so, each individual intermediate entity can be accessed by clicking on its name in the explorer.



For each one of the three intermediate entities, the mapping OUT definition must include the fields mandatory for either identifying or creating a given intermediate entity.

To set the value of a given field:

  • Select one or more fields in the CRM Name column.
  • Associate the name of a CPQ column in the text box of the CPQ Name column.

Saving the Mapping OUT is impossible while all the mandatory fields are not set. Optionally, for each intermediate entity, you can decide to check or not a box Indicating whether the creation of an intermediate entity is allowed for the sync process or not. If not, and if no existing entity can be used, the corresponding CPQ Quote Lines are not synced with CRM Products.

However, a specific behavior has been put in place for Price Lists: if the creation of Price Lists is allowed, only one Price List is created during the sync, gathering references to all Price List Items and optimizing performances. In that case, the Smart CPQ Mapping Set requires to set the default name of that list on the Price List entity screen:



PRODUCT SYNC SPECIFICS

Product Existence

Finding a Product or checking its existence in the CRM Catalog means identify it by its name.

Product Deletion

Product entities are never deleted on the MSCRM side during the synchronization process with CPQ.

Product Family or Parent

When synchronizing the “Parent” or “Family” of a Product, the corresponding Family must already exist in the CRM. It will not be created automatically. Finally, once a Product Family has been set, it cannot be updated. The same concept applies for any other attributes that has pre-defined values in the CRM (Picklist, Entity, etc.).

Select Primary Quotes for an Opportunity

FUNCTIONAL USE CASE

A Sales rep usually works 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 Primary Quotes for a given Opportunity. A Primary Quote for a given Opportunity can have its Quote Product items synchronized with its parent Opportunity. If the Quote is not primary for its parent Opportunity, its content will not be synchronized with this Opportunity, whatever the setup done in the Smart CPQ Mapping Set and Smart CPQ Setup entities.

PRIMARY QUOTES BEHAVIOR

In addition to the CPQ line items sync, an additional feature allows synchronizing CRM Quote Products 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.

In detail:

  • One or several Quotes can be set as Primary Quotes for their parent Opportunity.
  • When creating a Quote, the default value of the Primary Quote is set according to the corresponding setting in the Smart CPQ Setup entity. See here for more details:Associate CPQ Attributes to CRM Quotes.
  • A Quote can be set as Primary (in the context of its parent Opportunity) by checking the Primary Quote box in the corresponding Quote form.


  • The content of the Primary Quotes can be synchronized with the Opportunity under the format of Opportunity Products.
  • The content of Quotes that are not set as Primary is not synchronized with their parent Opportunity entity.
  • When a non-Primary Quote is set to a Primary Quote for its Opportunity, a copy is triggered

    between the Quote Products entities of the Primary Quote and the Opportunity Products.

  • When a Primary Quote is set to non-Primary, 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.
    Note: This behavior applies only for Quote forms coming from the Smart CPQ managed solution or duplicates from it.
    Warning: Opportunity Products as 2nd Level Entities - As Opportunity Products can be created or updated via the Primary Quote feature, their mapping cannot be defined as a 2nd level entity part of the Mapping OUT.
    Note: Opportunity Sync Status - The Primary Quote sync is asynchronous. If you need to know when it ends to trigger additional workflows, a status field (prosqtx_qtx_sync_status) is available in the Smart CPQ managed solution. It surfaces the status of the quote content deletion and / or creation at the Opportunity level.

    In the scenario when the Opportunity linked to a given Primary Quote is modified in the CRM, then the deletion status is reflected in the source Opportunity and the creation status is reflected in the destination Opportunity.

PRIMARY QUOTE CREATED FROM AN OPPORTUNITY

MSCRM allows creating Quotes from an Opportunity. This capability comes with a constraint from the CRM - whenever a Quote is created from an Opportunity, if the Opportunity contains some Opportunity Products, then the content of the CRM Quote created is defaulted with those Opportunity Products. If, by default, a Quote is created as a Primary Quote, it implies that its content is synced with the Opportunity. Based on those two statements, it means that whenever a Quote defaulted as Primary is created from an Opportunity containing products, the Opportunity content is automatically duplicated.

Later on in the process, the end user will have the ability to enter the CPQ Quote to add products there and sync them back to the CRM Quote and Opportunity. In that case, the initially duplicated content of the Opportunity will be replaced by the corresponding CPQ content for that Quote.

Alternatively, the you can decide to trigger the Sync CPQ action from the CRM Quote - as the CPQ

Quote is created via this action when triggered for the first time, it is empty. The corresponding content of the CRM Quote and Opportunity is thus be deleted until the you actually adds products in the CPQ Quote.