Salesforce Integration - Configuration in CPQ
Salesforce Integration - Configuration in CPQ
INTEGRATION ADAPTER BY
CLARITY
2
SFDC Tags ......................................................................................................................................... 72
Important Notes ................................................................................................................................... 73
3
Revision History
Revision Revision Date Summary of Changes Revised By
Vesrion
V1.0 20/12/2022 - Initial Version Brian Luk Tong
- Quote access control feature
V1.1 06/02/2023 Brian Luk Tong
introduced
- Custom Implementation:
Replacement of code snippets
V1.2 09/02/2023 changed for Brian Luk Tong
SFEnvironment.OpportunityId and
SFEnvironment.Opportunity.Id
- Added new feature for Tag Caching
in the section Class:
CL_GeneralIntegrationSettings
V1.3 15/02/2023 - Added section Class: Brian Luk Tong
CL_CrmIdBusinessPartnerMapping.
Related to Business Partner
configurations
- Custom Implementation:
Added code snippet replacements
V1.4 16/02/2023 Brian Luk Tong
for Quote.OpportunityId and
Quote.OpportunityName
- Opportunity Line-Item Mapping:
Added FieldType parameter in
mappings definition table
V1.5 03/03/2023 Brian Luk Tong
- Custom Object Line-Item Mapping:
Updated FieldType parameter in
mappings definition table
- Custom Implementations: Code
snippets for
SFEnvironment.GetAccount(1),
SFEnvironment.GetValueByQuery,
V 1.6 20/03/2023 SalesforceProxy.Binding.query Brian Luk Tong
- Custom Object -> Standard Objects
->Define Objects: Updated code
snippets
4
Authorization
This section describes how to set up the authentication from Salesforce to SAP CPQ and how to set
up the integration user credentials in CPQ.
If you aren’t using Federated Single Sign-On with the SAP CPQ - Salesforce integration. In that case,
you need to set up the Trusted Applications in SAP CPQ to enable a seamless login experience
between the systems.
Please skip the Trusted Applications section if you are using Federated Single Sign-On with the SAP
CPQ – Salesforce Integration.
Trusted Applications
The Trusted Applications setup is used to set up the authentication between Salesforce and SAP
CPQ. This type of authentication is performed when the user lands on CPQ from Salesforce. This
feature allows us to login automatically as the desired CPQ user without having to go through the
CPQ login page.
• Name à Salesforce
• Issuer à URL of the Salesforce domain (for example: https://claritycx-dev-
ed.lightning.force.com)
Save and retrieve the Configuration Client Identifier, Configuration Client Secret and JWT Token
Signing Key. Provide those parameters to the responsible party on the Salesforce side.
Credential Management
To enable CPQ to communicate with Salesforce and exchange information, we need to set up the
Salesforce Admin Integration user credentials in CPQ.
Name CPQ_SFDC_PWD
Identifier Salesforce Integration Username
Secret Salesforce Integration Password + User Secret
Token
5
Example:
Password à pwd123
Secret Token à 789654
Then the secret entry should be set as à
pwd123789654
Name CPQ_SFDC_SECRET
Identifier Salesforce Client Identifier (Consumer Key of
the Connected App)
Secret Salesforce Client Secret (Consumet Secret of
the Connected App)
Global Scripts
Script Name
CPQ_SF_FunctionModules
CPQ_SF_IntegrationMessages
CPQ_SF_IntegrationModules
CPQ_SF_IntegrationReferences
CPQ_SF_IntegrationSettings
CPQ_SF_LineItemModules
CPQ_SF_OBJECT_TAG
CPQ_SF_OnLandingFromCRM
CPQ_SF_OPP_TAG
CPQ_SF_OpportunityLineItemMapping
CPQ_SF_OpportunityMapping
CPQ_SF_OpportunityStatusMapping
CPQ_SF_PriceBookMapping
CPQ_SF_QUERY_TAG
CPQ_SF_QuoteMapping
CPQ_SF_ACCOUNT_TAG
CPQ_SF_Configuration
CPQ_SF_ContactMapping
CPQ_SF_ContactModules
CPQ_SF_CONTAINER_QUERY_TAG
CPQ_SF_CpqHelper
CPQ_SF_CreateQuote
CPQ_SF_CreateUpdateOpportunity
CPQ_SF_CustomerMapping
6
CPQ_SF_CustomerModules
CPQ_SF_CustomObjectLineItemMapping
CPQ_SF_CustomObjectLineItemModules
CPQ_SF_CustomObjectMapping
CPQ_SF_CustomObjectModules
CPQ_SF_EditQuote
CPQ_SF_ErrorHandler
7
Custom Actions
Action Name
Attach Salesforce Opportunity to Quote
Create/Update Salesforce Objects From Quote Items
Create/Update Salesforce Opportunity
Detach From Salesforce Opportunity
Post Quote Notes Into Salesforce Account Chatter
Post Quote Notes Into Salesforce Opportunity
Chatter
Reassign to Salesforce Opportunity
Send Generated Document to Salesforce
8
Custom Actions
Action Name
Attach Salesforce Opportunity to Quote
Create/Update Salesforce Objects From Quote Items
Create/Update Salesforce Opportunity
Detach From Salesforce Opportunity
Post Quote Notes Into Salesforce Account Chatter
Post Quote Notes Into Salesforce Opportunity
Chatter
Reassign to Salesforce Opportunity
Send Generated Document to Salesforce
9
Configuration
Quote Table
Note: Quote tables should not be deployed from tenant to tenant. This quote table should
already be created prior to the migration phase.
10
Custom Fields
Those 2 custom fields should normally be already created prior to the migration phase.
Name CPQ_SF_OPPORTUNITY_ID
Type Free Form
Default Label Opportunity ID
Name CPQ_SF_OPPORTUNITY_NAME
Type Free Form
Default Label Opportunity Name
If the standard fields Opportunity ID and Opportunity Name are shown on the Quote screen, we
should replace them (Permissions & Quote Tab) with the custom fields that are now designated to
be used in the new integration.
11
Workflow
This section describes the available actions that can be used with the new integration package.
Below is the list of custom actions available for this integration package.
Create/Update Salesforce Objects From Quote Items This action is used to Create/Update Salesforce Objects
based on the line items in the Quote.
Post Quote Notes Into Salesforce Account Chatter This custom action is the substitute of the standard
action Post Quote Notes Into Account Chatter.
This action posts the CPQ Quote Cart Comment into the
Salesforce Opportunity Account Chatter.
Post Quote Notes Into Salesforce Opportunity This custom action is the substitute of the standard
Chatter action Post Quote Notes Into Opportunity Chatter.
This action posts the CPQ Quote Cart Comment into the
Salesforce Opportunity Chatter.
Reassign to Salesforce Opportunity Important Note: This custom action should only be
used as a post action on the standard action Reassign.
12
This action recreates the Quote record on Salesforce
with the appropriate Quote ID and Owner ID (Which is
altered during Reassign).
Send Generated Document to Salesforce This custom action is the substitute of the standard
action Send Document to CRM.
This action uploads the latest generated document to
the Notes & Attachments section of the Salesforce
Opportunity.
Configure the workflow with the above listed custom actions as per your needs. Please note that if
the standard integration actions are used as Post Actions they need to be removed to ensure
consistency in the integration.
Workflow Permissions
Depending on your needs, you should enable the permissions on the custom actions described in
section Workflow.
13
Script Configuration
This section describes the settings and mapping setup of the integration. All settings and mappings
are defined within Global Scripts.
Please note that all the scripting files can be tenant-specific, depending on how aligned your tenants
are (DEV/TEST/PROD).
Initial Setup
Configuration File
Script name: CPQ_SF_Configuration.
This script stores the basic settings of the Salesforce Tenant and CPQ Tenant.
This scripting file is tenant specific. The values will differ whether we are on the clients
DEV/TEST/PROD tenant.
Parameter Description
CPQ_URL SAP CPQ URL
SALESFORCE_URL Salesforce URL that is used in the API calls
Example à
https://MyDomainName.my.salesforce.com/
SALESFORCE_VERSION Version of the Salesforce API
Set it to à 55.0
SALESFORCE_PWD The name of the key used in Credentials
Management (Credential Management) to
store the Salesforce Integration Username &
Password
SALESFORCE_SECRET The name of the key used in Credentials
Management (Credential Management) to
store the Salesforce Client Identifier and Client
Secret
14
Integration Settings
Script name: CPQ_SF_IntegrationSettings.
This script stores the toggles for the features that we enable/disable and other integration
parameters.
Class: CL_GeneralIntegrationSettings
This class stores the integration features that you can enable/disable. It contains some of the
features from the standard CRM Integation à General setup.
Parameter Description
UPDATE_EXISTING_PRODUCTS_IN_SALESFORCE True/False
15
This parameter controls the integration
feature “Update existing products in
Salesforce when sending data from SAP
CPQ items”.
PRODUCT_TYPE_EXCLUSION This parameter is a list of all Product
Type names that should be excluded
from the integration
ONLY_ONE_QUOTE_LINKED_TO_OPPORTUNITY True/False
16
When the parameter is set to True:
- When executing the TAG scripts,
the system will first check if
within your CPQ login session
(User Session) that particular
TAG script has been executed
with the exact same parameters.
If yes, system will not call
Salesforce but retrieve the
information from the Session. If
no, system will call Salesforce to
retrieve the requested
information
Class: CL_CpqIntegrationParams
This class stores the custom field names of the Opportunity ID and the Opportunity Name.
Parameter Description
OPPORTUNITY_ID_FIELD Configure String of the Custom field
name used to store the Opportunity ID.
17
Class: CL_SalesforceQuoteParams
This class stores parameters related to the Quote object on Salesforce. This setup is the equivalent
of the standard CRM Integration à CRM Quote setup.
Parameter Description
SF_QUOTE_OBJECT Name of the Salesforce Quote Object
used by the client.
18
SF_QUOTE_ID_FIELD Name of the Salesforce Quote ID field
in the Quote Object used by the client.
Class: CL_CrmIdBusinessPartnerMapping
This is for Quote 2.0 only.
This class is used to store the Business Partner Field that is used to keep the Account/Contact Id of
Salesforce Account/Contact records. By default we store the Salesforce Account/Contact Ids in the
standard business partner field ExternalId.
19
Here you’ll need to fill the dictionary keys listed below.
Parameter Description
CpqField Business Partner technical field name
CpqFieldType Should be set to either
CPQ_BP_STANDARD_FIELD or
CPQ_BP_CUSTOM_FIELD.
CPQ_BP_CUSTOM_FIELD – Indicates
that the business partner field specified
in the parameter CpqField is a Business
Partner Custom Fields.
CPQ_BP_STANDARD_FIELD – Indicates
that the business partner field specified
in the parameter CpqField is a standard
out of the box field on the Business
Partner.
20
Mapping
Opportunity Mapping
Script name: CPQ_SF_OpportunityMapping.
This script stores the mapping between the SAP CPQ Quote and the Salesforce Opportunity, both
inbound and outbound. You should configure the Opportunity mapping here. You should transcribe
all standard mappings found in the Custom Fields Mappings section.
All mappings that use the CRM Object Opportunity should be configured in the
CPQ_SF_Opportunity_Mapping file.
In the script we have 3 functions each for inbound and outbound mappings.
21
Outbound (SAP CPQ à Salesforce)
Function Description
on_opp_create_outbound_opportunity_integration_mapping This section is the
equivalent of the Standard
mappings stored in tab
Opportunity
Creation/Update from
SAP CPQ.
All mappings with the
Event Object Create.
on_opp_update_outbound_opportunity_integration_mapping This section is the
equivalent of the Standard
mappings stored in tab
Opportunity
Creation/Update from
SAP CPQ.
22
All mappings with the
Event Object Update.
on_opp_createupdate_outbound_opportunity_integration_mapping This section is the
equivalent of the Standard
mappings stored in tab
Opportunity
Creation/Update from
SAP CPQ.
All mappings with the
Event Object Create
Update.
Inbound (Salesforce à SAP CPQ)
Function Description
on_quote_create_inbound_opportunity_integration_mapping This section is the
equivalent of the
Standard mappings stored
in tab Quote
Creation/Update from
CRM.
All mappings with the
Event Quote Create.
on_quote_update_inbound_opportunity_integration_mapping This section is the
equivalent of the
Standard mappings stored
in tab Quote
Creation/Update from
CRM.
23
All mappings with the
Event Quote Update.
on_quote_createupdate_inbound_opportunity_integration_mapping This section is the
equivalent of the
Standard mappings stored
in tab Quote
Creation/Update from
CRM.
All mappings with the
Event Quote Create
Update.
Quote Mapping
Script name: CPQ_SF_QuoteMapping
This script stores the mapping between the SAP CPQ Quote and the Salesforce Quote. This mapping
only goes in the Outbound direction (SAP CPQàSalesforce).
You should transcribe all Standard Mappings found in the CRM Quote section.
24
Opportunity Status Mapping
Script name: CPQ_SF_OpportunityStatusMapping
This script stores the status mapping between the SAP CPQ Quote and the Salesforce Quote.
You should transcribe all Standard Mappings found in the Opportunity Status section.
25
Price Book Mapping
Script name: CPQ_SF_PriceBookMapping
• The mapping of the Salesforce Custom Price Books with the SAP CPQ Market
• The Salesforce Id of the Standard Price Book
We should transcribe all Standard Mappings found in the Price Book Market Mappings section.
The Salesforce Id of the Standard Price Book should be stored in the variable
STANDARD_PRICE_BOOK_ID.
The Price Book Mapping should be stored in list format as defined in the above screenshot. The list
should have to dictionary keys:
- CPQ_MARKET_ID: The SAP CPQ Market ID. Please note that this ID can be different per
tenant (Dev/Qual/Prod).
- SF_PRICEBOOK_ID: The Salesforce ID of the custom price book. Please note that this ID can
be different per tenant (Dev/Qual/Prod).
In case there is no price book mapping leave the list defined as shown below.
26
Customer Roles Mapping (Quote 1.0 Only)
Script name: CPQ_SF_CustomerMapping
This script file stores all the mappings involving the SAP CPQ Customer Role and the Account object
in Salesforce.
There are 3 parameters each representing one customer role in SAP CPQ.
The possible Salesforce Accounts that can be mapped to are defined as properties of the class
CL_SalesforceAccountObjects. If the Customer Role is not mapped to any Salesforce Account set it
as None.
After mapping the Customer Role and the Salesforce Account, you define which fields need to be
mapped. For the outbound integration we have 3 functions each for each Customer Role in SAP CPQ.
Function Description
on_opportunity_create_{customer This section is the equivalent of the Standard
role}_mapping mappings where:
- Setup à CRM Integration à Customer
Roles Mappings
- Tab à Opportunity Creation/Update
from SAP CPQ
- Event à Object Create
- Field mapping set to Account
We should populate all the mappings in the
form of a dictionary. Where the key is the
technical Salesforce field name.
on_opportunity_update_{customer This section is the equivalent of the Standard
role}__mapping mappings where:
27
- Setup à CRM Integration à Customer
Roles Mappings
- Tab à Opportunity Creation/Update
from SAP CPQ
- Event à Object Update
- Field mapping set to Account
We should populate all the mappings in the
form of a dictionary. Where the key is the
technical Salesforce field name.
on_opportunity_createupdate_{customer This section is the equivalent of the Standard
role}_mapping mappings where:
- Setup à CRM Integration à Customer
Roles Mappings
- Tab à Opportunity Creation/Update
from SAP CPQ
- Event à Object Create Update
- Field mapping set to Account
We should populate all the mappings in the
form of a dictionary. Where the key is the
technical Salesforce field name.
There are 3 parameters each representing one customer role in SAP CPQ.
The possible Salesforce Accounts that can be mapped to are defined as properties of the class
CL_SalesforceAccountObjects. If the Customer Role is not mapped to any Salesforce Account set it
as None.
After mapping the Customer Role and the Salesforce Account, define which fields need to be
mapped. For the outbound integration we have 3 functions each for each Customer Role in SAP CPQ.
Function Description
on_quote_create_{customer role}_mapping This section is the equivalent of the Standard
mappings where:
- Setup à CRM Integration à Customer
Roles Mappings
- Tab à Opportunity Creation/Update
from SAP CPQ
- Event à Quote Create
- Field mapping set to Account
28
We should set the inbound mappings by using
the variable cpqCustomer which is the
representation of the Customer Interface in
SAP CPQ. We can retrieve all information from
the Salesforce account via the variable
salesforceCustomer which stores the
information of the Salesforce Account.
on_quote_update_{customer role}__mapping This section is the equivalent of the Standard
mappings where:
- Setup à CRM Integration à Customer
Roles Mappings
- Tab à Opportunity Creation/Update
from SAP CPQ
- Event à Quote Update
- Field mapping set to Account
We should set the inbound mappings by using
the variable cpqCustomer which is the
representation of the Customer Interface in
SAP CPQ. We can retrieve all information from
the Salesforce account via the variable
salesforceCustomer which stores the
information of the Salesforce Account.
on_quote_createupdate_{customer This section is the equivalent of the Standard
role}_mapping mappings where:
- Setup à CRM Integration à Customer
Roles Mappings
- Tab à Opportunity Creation/Update
from SAP CPQ
- Event à Quote Create Update
- Field mapping set to Account
We should set the inbound mappings by using
the variable cpqCustomer which is the
representation of the Customer Interface in
SAP CPQ. We can retrieve all information from
the Salesforce account via the variable
salesforceCustomer which stores the
information of the Salesforce Account.
This script file stores all the mappings involving the SAP CPQ Partner Function and Account object on
Salesforce.
In this class we need to define the partner functions we want to map and the Salesforce Account
target.
29
The possible Salesforce Accounts that can be mapped to are defined as properties of the class
CL_SalesforceAccountObjects. This mapping is stored in a list variable which has the following
dictionary keys:
If the Partner Function is not mapped to any Salesforce Account do not add it to the list.
After mapping the Partner Function and the Salesforce Account, define which fields need to be
mapped.
Function Description
on_opportunity_create_mapping This section is the equivalent of the Standard
mappings where:
- Setup à CRM Integration à Partner
Functions Mapping
- Tab à Opportunity Creation/Update
from SAP CPQ
- Event à Object Create
- CRM Object à Account
We should populate all the mappings in the
form of a dictionary. Where the key is the
technical Salesforce field name.
on_opportunity_update_mapping This section is the equivalent of the Standard
mappings where:
- Setup à CRM Integration à Partner
Functions Mapping
- Tab à Opportunity Creation/Update
from SAP CPQ
- Event à Object Create
- CRM Object à Account
We should populate all the mappings in the
form of a dictionary. Where the key is the
technical Salesforce field name.
30
on_opportunity_createupdate_mapping This section is the equivalent of the Standard
mappings where:
- Setup à CRM Integration à Partner
Functions Mapping
- Tab à Opportunity Creation/Update
from SAP CPQ
- Event à Object Create
- CRM Object à Account
We should populate all the mappings in the
form of a dictionary. Where the key is the
technical Salesforce field name.
In this class you need to define the partner functions you want to map and the Salesforce Account
target.
The possible Salesforce Accounts that can be mapped to are defined as properties of the class
CL_SalesforceAccountObjects. This mapping is stored in a list variable which has the following
dictionary keys:
If the Partner Function is not mapped to any Salesforce Account do not add it to the list.
After mapping the Partner Function and the Salesforce Account, define which fields need to be
mapped.
31
Function Description
on_quote_create_mapping This section is the equivalent of the Standard
mappings where:
- Setup à CRM Integration à Partner
Functions Mapping
- Tab à Quote Creation/Update from
SAP CPQ
- Event à Quote Create
- CRM Object à Account
There should be an if condition to separate the
mappings for each partner function.
We should set the inbound mappings by using
the variable cpqBusinessPartner which is the
representation of the Business Partner
Interface in SAP CPQ. We can retrieve all
information from the Salesforce account via
the variable salesforceCustomer which stores
the information of the Salesforce Account.
on_quote_update_mapping This section is the equivalent of the Standard
mappings where:
- Setup à CRM Integration à Partner
Functions Mapping
- Tab à Quote Creation/Update from
SAP CPQ
- Event à Quote Update
- CRM Object à Account
There should be an if condition to separate the
mappings for each partner function.
We should set the inbound mappings by using
the variable cpqBusinessPartner which is the
representation of the Business Partner
Interface in SAP CPQ. We can retrieve all
information from the Salesforce account via
the variable salesforceCustomer which stores
the information of the Salesforce Account.
on_quote_createupdate_mapping This section is the equivalent of the Standard
mappings where:
- Setup à CRM Integration à Partner
Functions Mapping
- Tab à Quote Creation/Update from
SAP CPQ
- Event à Quote Create
- CRM Object à Account
There should be an if condition to separate the
mappings for each partner function.
We should set the inbound mappings by using
the variable cpqBusinessPartner which is the
representation of the Business Partner
Interface in SAP CPQ. We can retrieve all
information from the Salesforce account via
32
the variable salesforceCustomer which stores
the information of the Salesforce Account.
Note: When setting country on the SAP CPQ Business Partner, use the exposed function
get_country_code_from_abrev3, to convert the country Alpha-3 code (EUR) received from
Salesforce to Alpha-2 code (EU) that is expected by SAP CPQ. This is valid for Quote 2.0 only.
33
Contact Mapping for Quote 1.0
Script name: CPQ_SF_ContactMapping
This script file stores all the mappings involving the SAP CPQ Customer Roles and Contact object on
Salesforce.
In this class you need to define the Customer Roles you want to map and the Salesforce Account
target.
The possible Salesforce Contacts that can be mapped to are defined as properties of the class
CL_SalesforceContactObjects. If the Customer Role is not mapped to any Salesforce Contact set it as
None.
After mapping the Customer Role and the Salesforce Account, define which fields need to be
mapped. For the outbound integration you have 3 functions each for each Customer Role in SAP
CPQ.
Function Description
on_opportunity_create_{customer This section is the equivalent of the Standard
role}_mapping mappings where:
- Setup à CRM Integration à Customer
Roles Mappings
- Tab à Opportunity Creation/Update
from SAP CPQ
- Event à Object Create
- Field mapping set to Contact
We should populate all the mappings in the
form of a dictionary. Where the key is the
technical Salesforce field name.
on_opportunity_update_{customer This section is the equivalent of the Standard
role}__mapping mappings where:
- Setup à CRM Integration à Customer
Roles Mappings
- Tab à Opportunity Creation/Update
from SAP CPQ
- Event à Object Update
- Field mapping set to Contact
34
We should populate all the mappings in the
form of a dictionary. Where the key is the
technical Salesforce field name.
on_opportunity_createupdate_{customer This section is the equivalent of the Standard
role}_mapping mappings where:
- Setup à CRM Integration à Customer
Roles Mappings
- Tab à Opportunity Creation/Update
from SAP CPQ
- Event à Object Create Update
- Field mapping set to Contact
We should populate all the mappings in the
form of a dictionary. Where the key is the
technical Salesforce field name.
There are 3 parameters each representing one customer role in SAP CPQ.
The possible Salesforce Contacts that can be mapped to are defined as properties of the class
CL_SalesforceContactObjects. If the Customer Role is not mapped to any Salesforce Contact set it as
None.
After mapping the Customer Role and the Salesforce Contact, define which fields need to be
mapped. For the outbound integration you have 3 functions each for each Customer Role in SAP
CPQ.
Function Description
on_quote_create_{customer role}_mapping This section is the equivalent of the Standard
mappings where:
- Setup à CRM Integration à Customer
Roles Mappings
- Tab à Opportunity Creation/Update
from SAP CPQ
- Event à Quote Create
- Field mapping set to Contact
We should set the inbound mappings by using
the variable cpqCustomer which is the
representation of the Customer Interface in
SAP CPQ. We can retrieve all information from
35
the Salesforce contact via the variable
salesforceContact which stores the
information of the Salesforce Account.
on_quote_update_{customer role}__mapping This section is the equivalent of the Standard
mappings where:
- Setup à CRM Integration à Customer
Roles Mappings
- Tab à Opportunity Creation/Update
from SAP CPQ
- Event à Quote Update
- Field mapping set to Contact
We should set the inbound mappings by using
the variable cpqCustomer which is the
representation of the Customer Interface in
SAP CPQ. We can retrieve all information from
the Salesforce contact via the variable
salesforceContact which stores the
information of the Salesforce Account.
on_quote_createupdate_{customer This section is the equivalent of the Standard
role}_mapping mappings where:
- Setup à CRM Integration à Customer
Roles Mappings
- Tab à Opportunity Creation/Update
from SAP CPQ
- Event à Quote Create Update
- Field mapping set to Contact
We should set the inbound mappings by using
the variable cpqCustomer which is the
representation of the Customer Interface in
SAP CPQ. We can retrieve all information from
the Salesforce contact via the variable
salesforceContact which stores the
information of the Salesforce Account.
36
Contact Mapping for Quote 2.0
Script name: CPQ_SF_ContactMapping
This script file stores all the mappings involving the SAP CPQ Partner Functions and Contact object
on Salesforce.
In this class you need to define the partner functions you want to map and the Salesforce Contact
target.
The possible Salesforce Contacts that can be mapped to are defined as properties of the class
CL_SalesforceContactObjects. This mapping is stored in a list variable which has the following
dictionary keys:
If the Partner Function is not mapped to any Salesforce Contact do not add it to the list.
After mapping the Partner Function and the Salesforce Contact, define which fields need to be
mapped.
Function Description
on_opportunity_create_{customer This section is the equivalent of the Standard
role}_mapping mappings where:
- Setup à CRM Integration à Partner
Functions Mappings
- Tab à Opportunity Creation/Update
from SAP CPQ
- Event à Object Create
- Field mapping set to Contact
We should populate all the mappings in the
form of a dictionary. Where the key is the
technical Salesforce field name.
37
on_opportunity_update_{customer This section is the equivalent of the Standard
role}__mapping mappings where:
- Setup à CRM Integration à Partner
Functions Mappings
- Tab à Opportunity Creation/Update
from SAP CPQ
- Event à Object Update
- Field mapping set to Contact
We should populate all the mappings in the
form of a dictionary. Where the key is the
technical Salesforce field name.
on_opportunity_createupdate_{customer This section is the equivalent of the Standard
role}_mapping mappings where:
- Setup à CRM Integration à Partner
Functions Mappings
- Tab à Opportunity Creation/Update
from SAP CPQ
- Event à Object Create Update
- Field mapping set to Contact
We should populate all the mappings in the
form of a dictionary. Where the key is the
technical Salesforce field name.
The possible Salesforce Contacts that can be mapped to are defined as properties of the class
CL_SalesforceContactObjects. This mapping is stored in a list variable which has the following
dictionary keys:
If the Partner Function is not mapped to any Salesforce Contact do not add it to the list.
38
After mapping the Partner Function and the Salesforce Contact, define which fields need to be
mapped.
Function Description
on_quote_create_contact_mapping This section is the equivalent of the Standard
mappings where:
- Setup à CRM Integration à Partner
Functions Mappings
- Tab à Opportunity Creation/Update
from SAP CPQ
- Event à Quote Create
- Field mapping set to Contact
There should be an if condition to separate the
mappings for each partner function.
We should set the inbound mappings by using
the variable cpqBusinessPartner which is the
representation of the Business Partner
Interface in SAP CPQ. We can retrieve all
information from the Salesforce contact via the
variable salesforceContact which stores the
information of the Salesforce Contact.
on_quote_update_contact_mapping This section is the equivalent of the Standard
mappings where:
- Setup à CRM Integration à Partner
Functions Mappings
- Tab à Opportunity Creation/Update
from SAP CPQ
- Event à Quote Update
- Field mapping set to Contact
There should be an if condition to separate the
mappings for each partner function.
We should set the inbound mappings by using
the variable cpqBusinessPartner which is the
representation of the Business Partner
Interface in SAP CPQ. We can retrieve all
information from the Salesforce contact via the
variable salesforceContact which stores the
information of the Salesforce Contact.
on_quote_createupdate_contact_mapping This section is the equivalent of the Standard
mappings where:
- Setup à CRM Integration à Partner
Functions Mappings
- Tab à Opportunity Creation/Update
from SAP CPQ
- Event à Quote Create Update
- Field mapping set to Contact
There should be an if condition to separate the
mappings for each partner function.
We should set the inbound mappings by using
the variable cpqBusinessPartner which is the
representation of the Business Partner
Interface in SAP CPQ. We can retrieve all
39
information from the Salesforce contact via the
variable salesforceContact which stores the
information of the Salesforce
Contact.salesforceContact which stores the
information of the Salesforce Account.
This Script stores custom objects that can be defined by the user. The custom objects defined in this
script can only be mapped to the SAP CPQ Quote object.
Custom Objects
You should transcribe all Standard Mappings found in the Custom Fields Mapping section that have
the CRM Object set to a Custom Object (Not Opportunity).
Define Objects
Depending on the mapping needs, you should define the object in the function
custom_object_mappings. This function contains the definition of all objects that are uses in the
mappings.
You should define 1 entry in the list per object. The list should have the following Dictionary keys:
- Name à Name of the Custom Object (Should not contain any spaces)
- Type à The Salesforce Object it is linked to
- Query à SOQL query which fetches the ID of the record that needs to be updated
- Linked To Quote à Boolean that states whether the object is linked to the Quote. One-to-
One relationship with the Quote
- Inbound à Boolean that states if Inbound mappings need to be processed
- Outbound à Boolean that states if Outbound mappings need to be processed
- Create à
o If set to True
§ For Query objects when no records exist when executing the query, then
SAP CPQ will create the record based on the mapping
§ For Linked to Quote objects, if no linkage is found on the Quote. Then SAP
CPQ will create the record based on the mapping
o If set to False
§ For Query objects when no records exist when executing the query, then
SAP CPQ will skip the mappings for that object
§ For Linked to Quote objects, if no linkage is found on the Quote. Then SAP
CPQ will skip the mappings for that object
Define Mappings
Outbound (SAP CPQ à Salesforce)
Function Description
on_opp_create_custom_object_mapping This section is the equivalent of the Standard
mappings where:
- Setup à CRM Integration à Custom
Fields Mappings
40
-Tab à Opportunity Creation/Update
from SAP CPQ
- Event à Object Create
- CRM Object set to a custom object
There should be an if condition on the
customObjectName for each custom object we
want to map.
We should populate all the mappings in the
form of a dictionary. Where the key is the
technical Salesforce field name.
on_opp_update_custom_object_mapping This section is the equivalent of the Standard
mappings where:
- Setup à CRM Integration à Custom
Fields Mappings
- Tab à Opportunity Creation/Update
from SAP CPQ
- Event à Object Update
- CRM Object set to a custom object
There should be an if condition on the
customObjectName for each custom object we
want to map.
We should populate all the mappings in the
form of a dictionary. Where the key is the
technical Salesforce field name.
on_opp_createupdate_custom_object_mapping This section is the equivalent of the Standard
mappings where:
- Setup à CRM Integration à Custom
Fields Mappings
- Tab à Opportunity Creation/Update
from SAP CPQ
- Event à Object Create Update
- CRM Object set to a custom object
There should be an if condition on the
customObjectName for each custom object we
want to map.
We should populate all the mappings in the
form of a dictionary. Where the key is the
technical Salesforce field name.
41
There should be an if condition on the
customObjectName for each custom object
we want to map.
We should populate all the mappings in the
form of a dictionary. Where the key is the
technical Salesforce field name.
on_quote_update_custom_object_mapping This section is the equivalent of the Standard
mappings where:
- Setup à CRM Integration à Custom
Fields Mappings
- Tab à Quote Creation/Update from
SAP CPQ
- Event à Quote Update
- CRM Object set to a custom object
There should be an if condition on the
customObjectName for each custom object
we want to map.
We should populate all the mappings in the
form of a dictionary. Where the key is the
technical Salesforce field name.
on_quote_createupdate_custom_object_mapping This section is the equivalent of the Standard
mappings where:
- Setup à CRM Integration à Custom
Fields Mappings
- Tab à Quote Creation/Update from
SAP CPQ
- Event à Quote Create Update
- CRM Object set to a custom object
There should be an if condition on the
customObjectName for each custom object
we want to map.
We should populate all the mappings in the
form of a dictionary. Where the key is the
technical Salesforce field name.
Standard Objects
You should transcribe all Standard Mappings found in the Custom Fields Mapping section that have
the CRM Object set to either:
Opportunity Account
42
Opportunity Ship To Role
43
Define Objects
Depending on the mapping needs, you should define the object in the function
custom_object_mappings. This function contains the definition of all objects that are used in the
mappings.
The objects must be defined by default with the parameter “Create” set to False.
You should define 1 entry in the list per object. The list should have the following Dictionary keys:
- Name à Name of the Custom Object (Should not contain any spaces)
- Type à The Salesforce Object it is linked to
- Query à SOQL query which fetches the ID of the record that needs to be updated
- Linked To Quote à This parameter should remain set as False. It is not valid for Standard
Objects that you are defining
- Inbound à Boolean that states if Inbound mappings need to be processed
- Outbound à Boolean that states if Outbound mappings need to be processed
- Create à Always set to False
Below are the code snippets to define the Standard Objects in the custom_object_mappings
function.
44
Opportunity Partner Role Account Ship OpportunityPartnerRoleAccountShipTo.py
To
Opportunity Partner Role Account End OpportunityPartnerRoleAccountEndUser.py
User
Define Mappings
Outbound (SAP CPQ à Salesforce)
Function Description
on_opp_create_custom_object_mapping This section is the equivalent of the Standard
mappings where:
- Setup à CRM Integration à Custom
Fields Mappings
- Tab à Opportunity Creation/Update
from SAP CPQ
- Event à Object Create
- CRM Object set is not a custom object
and is not the Opportunity Object
There should be an if condition on the
customObjectName for each custom object we
want to map.
We should populate all the mappings in the
form of a dictionary. Where the key is the
technical Salesforce field name.
on_opp_update_custom_object_mapping This section is the equivalent of the Standard
mappings where:
- Setup à CRM Integration à Custom
Fields Mappings
- Tab à Opportunity Creation/Update
from SAP CPQ
- Event à Object Update
- CRM Object set is not a custom object
and is not the Opportunity Object
There should be an if condition on the
customObjectName for each custom object we
want to map.
We should populate all the mappings in the
form of a dictionary. Where the key is the
technical Salesforce field name.
on_opp_createupdate_custom_object_mapping This section is the equivalent of the Standard
mappings where:
- Setup à CRM Integration à Custom
Fields Mappings
- Tab à Opportunity Creation/Update
from SAP CPQ
- Event à Object Create Update
- CRM Object set is not a custom object
and is not the Opportunity Object
There should be an if condition on the
customObjectName for each custom object we
want to map.
45
We should populate all the mappings in the
form of a dictionary. Where the key is the
technical Salesforce field name.
46
There should be an if condition on the
customObjectName for each custom object
we want to map.
We should populate all the mappings in the
form of a dictionary. Where the key is the
technical Salesforce field name.
47
Opportunity Line-Item Mapping
Script name: CPQ_SF_OpportunityLineItemMapping
This script stores the mapping between the SAP CPQ Quote Items and the Salesforce
OpportunityLineItem Object.
We should transcribe all Standard Mappings found in the CRM Item Mappings (Tab Create/Update
Standard SFDC Objects from Quote Items) section.
48
This script has 3 functions.
Function Description
opplineitem_integration_mapping This section is the equivalent of the Standard mappings
where:
- CRM Object Type à OpportunityLineItem
- Parent Object Lookup à False
We should populate all the mappings in the form of a
dictionary.
Function Parameters:
- Quote à IQuote Interface
- TagParserQuote àITagParserQuote Interface
- cpqItem à IQuoteItem Interface (represents the
current item)
product_integration_mapping This section is the equivalent of the Standard mappings
where:
- CRM Object Type à Product2
49
- Parent Object Lookup à False
We should populate all the mappings in the form of a
dictionary.
Function Parameters:
- Quote à IQuote Interface
- TagParserQuote àITagParserQuote Interface
- cpqItem à IQuoteItem Interface (represents the
current item)
get_product_lookups This section is the equivalent of the Standard mappings
where:
- CRM Object Type à Product2
- Parent Object Lookup à True
We should populate all the mappings in the form of a list.
The list should have the following dictionary keys:
- SalesforceField à The Salesforce field name
- CpqLookUpValue à The SAP CPQ value (usually item
field) that will be used for the look up
- FieldType à The data type of the Salesforce field
(self.TYPE_STRING/self.TYPE_FLOAT/self.TYPE_BOOL)
Function Parameters:
- Quote à IQuote Interface
- TagParserQuote àITagParserQuote Interface
- cpqItem à IQuoteItem Interface (represents the
current item)
This script stores the mapping between the SAP CPQ Quote Items and an Object on Salesforce. This
mapping is Outbound in nature only.
We should transcribe all Standard Mappings found in the CRM Item Mappings (Tab Create/Update
Custom SFDC Objects from Quote Items) section.
Define Objects
The Standard section Define Objects is the equivalent of the list variable defined in the class
CL_CustomObjectLineItemMapping.
50
We should define 1 entry in the list per object. The list should have the following Dictionary keys:
Note: We do not have the Object is updated in CRM feature. By default, this is in the unchecked
state.
For each custom object you define, you also need to set the Condition for creating/updating object.
This is set in the function custom_object_item_condition. There should be an if condition for each
object we defined. Within the if condition, you define what type of checks we want to perform to set
the condition as True/False.
51
52
Define Mappings
We have 2 functions defined to process the mappings.
Function Description
custom_object_item_lookups This section is the equivalent of the Standard mappings where:
- Parent Object Lookup à True
We should populate all the mappings in the form of a list
separated by an if condition for each custom object.
The list should contain the following dictionary keys:
- SalesforceField à Salesforce field name
- CpqLookUpValue à SAP CPQ value
- FieldType à The data type of the Salesforce field
(self.TYPE_STRING/self.TYPE_FLOAT/self.TYPE_BOOL)
Function Parameters:
- Quote à IQuote Interface
- TagParserQuote àITagParserQuote Interface
- customObjectName à Name of the Custom Object
custom_object_item_mappin This section is the equivalent of the Standard mappings where:
g - Parent Object Lookup à False
We should populate all the mappings in the form of a dictionary.
Mappings should be separated by an if condition for each custom
object.
53
Function Parameters:
- Quote à IQuote Interface
- TagParserQuote àITagParserQuote Interface
- customObjectName à Name of the Custom Object
- cpqItem à IQuoteItem Interface
54
Salesforce CTX Tags
We have the following CTX tags that need to be modified to adapt to our new implementation:
The Table below shows the list of Global Scripts that will be used to replace the SFDC Tags.
55
Note: These scripts can be used with the ScriptExecutor, <* ExecuteScript(...) *> and the
<*CTX( Quote.ExecuteScript() )*>. Depending on the usage with <* ExecuteScript(...) *>, it could
require the Quote context to exist.
Parameters:
- PROPERTY: The technical salesforce field name
Example:
<*CTX( Quote.ExecuteScript(CPQ_SF_ACCOUNT_TAG, {"PROPERTY":
"Name"}) )*>
Parameters:
- OBJECT_NAME: The Custom Object Name. Should not have any
spaces.
- PROPERTY: The technical salesforce field name
Example:
<*CTX( Quote.ExecuteScript(CPQ_SF_OBJECT_TAG, {"OBJECT_NAME":
"Opportunity_Decision_Maker", "PROPERTY": "Name"}) )*>
Parameters:
- PROPERTY: The technical salesforce field name
Example:
<*CTX( Quote.ExecuteScript(CPQ_SF_OPP_TAG, {"PROPERTY":
"Name"}) )*>
Parameters:
- QUERY: The SOQL Query. Should return one field only. All spaces
should be replaced with +
Example:
<*CTX( Quote.ExecuteScript(CPQ_SF_QUERY_TAG, {"QUERY":
"SELECT+Name+FROM+Opportunity+WHERE+Id=+'ASDSA14122342'"}) )*>
56
Same as above, with the only exception that brackets ( and ) in the SOQL
<*CTX( SFDC.QueryWithBrackets )*> query need to be replaced by square brackets [ and ] respectively.
Example:
<*CTX( Quote.ExecuteScript(CPQ_SF_QUERY_TAG, {"QUERY":
"SELECT+Name+FROM+Opportunity+WHERE+Id=['ASDSA14122342']"}) )*>
The Global Script CPQ_SF_CONTAINER_QUERY_TAG has been defined to replace the SFDC Container
Tags.
Note: The script can be used with the ScriptExecutor, <* ExecuteScript(...) *> and the
<*CTX( Quote.ExecuteScript() )*>. Depending on the usage with <* ExecuteScript(...) *>, it could
require the Quote context to exist.
Parameters:
- QUERY: The SOQL Query. All spaces should be replaced with +
- CONTAINER: Attribute Container Name
- COLUMNS: List of attribute Container Columns where the data
needs to be loaded into. If the Column Name contains spaces
replace the spaces with |||.
Example:
<* ExecuteScript(CPQ_SF_CONTAINER_QUERY_TAG,
{"QUERY":"SELECT+Name,Total_List_Price__c+FROM+Quote_Documen
t__c+WHERE+Opportunity__c='<*CTX( Quote.CustomField(CPQ_SF_OP
PORTUNITY_ID) )*>'",
"CONTAINER":"TestContainer",
"COLUMNS":["Col1","Col|||Number"]}) *>
<*CTX( Container.LoadF Same as above, with the only exception that brackets ( and ) in the
romSFDCQueryWithBra SOQL query need to be replaced by square brackets [ and ]
ckets )*> respectively.
57
Deactivate Standard CRM Integration
Before proceeding with below steps, please make sure all Standard Integration actions in the
workflow and custom implementations are removed/replaced and that all SFDC tags have been
replaced.
Deactivate the Standard Integration on the CPQ side when ready by following the below steps:
58
Custom Implementations
You may have developed scripts that use the interfaces SFEnvironment and SalesforceProxy. Those
interfaces need to be replaced in your custom scripts as they will be obsoleted.
Below is a list of known replacements for those interfaces (Note: List may be subject to change).
url = CL_SalesforceSettings.SALESFORCE_URL
url = CL_SalesforceSettings.SALESFORCE_URL
class_sf_integration_modules =
CL_SalesforceIntegrationModules(Quote,
TagParserQuote, None, Session)
# Get User Session
session =
class_sf_integration_modules.get_user_auth2_toke
n()
class_sf_integration_modules =
CL_SalesforceIntegrationModules(Quote,
TagParserQuote, None, Session)
# Get Admin Session
adminSession =
class_sf_integration_modules.get_admin_auth2_tok
en()
59
SalesforceProxy.Binding.qu from CPQ_SF_IntegrationModules import
ery CL_SalesforceIntegrationModules
class_sf_integration_modules =
CL_SalesforceIntegrationModules(Quote,
TagParserQuote, None, Session)
bearerToken =
class_sf_integration_modules.get_auth2_token()
headers =
class_sf_integration_modules.get_authorization_h
eader(bearerToken)
query = "?q=SOQL+QUERY"
response =
class_sf_integration_modules.call_soql_api(he
aders, query)
SFEnvironment.GetAccount from CPQ_SF_IntegrationModules import
(1) CL_SalesforceIntegrationModules
from CPQ_SF_IntegrationSettings import
CL_SalesforceIntegrationParams
(Note: 1 = BillTo, 2 = ShipTo,
class_sf_integration_modules =
3 = End User) CL_SalesforceIntegrationModules(Quote,
TagParserQuote, None, Session)
adminToken =
class_sf_integration_modules.get_admin_auth2_tok
en()
billToCustomer = Quote.BillToCustomer
if billToCustomer:
crmAccountId = billToCustomer.CrmAccountId
if crmAccountId:
response =
class_sf_integration_modules.get_sobject(adminTo
ken,
CL_SalesforceIntegrationParams.SF_ACCOUNT_OBJECT
, crmAccountId)
SFEnvironment.GetValueBy ScriptExecutor.Execute("CPQ_SF_QUERY_TAG",
Query {"QUERY": "SOQL Query"})
Please be aware that the integration uses the custom fields defined in section Custom Fields to link
the Quote to the Opportunity record on Salesforce. Therefore the following properties also need to
be replaced.
Troubleshooting
After configuration of all the scripts and the setting up of the workflow. You can now proceed with
the testing of the integration.
60
1. Developper Console à Captures by default all the communication between CPQ and
Salesforce
2. Log à Captures dumps by default. Will capture communication between CPQ and Salesforce
if the LOG_API_CALLS parameter is set to TRUE (Please see section à Class:
CL_GeneralIntegrationSettings)
3. Quote Messages à When CPQ receives Error Codes from Salesforce, the error message will
be displayed by default on the Quote as a Quote Message
Developper Console
Enable Full Mode to be able to capture the communication between CPQ and Salesforce.
Custom Actions
When executing the integration via a custom action the trace will be logged under Action à
/api/rd/v1/CartExecutionAction.
Inbound Integration
When coming from Salesforce into CPQ via Create New Quote/View Quote/Edit Quote actions, you
will need to be logged in CPQ prior to the testing to activate the Developper Console traces.
The traces of the inbound integration will be logged under the action à
/api/rd/v1/CrmLanding/LandFromCrm.
61
Filter Logger type à HttpWebClient.
Log
To capture requests and responses in the CPQ log, please enable the parameter LOG_API_CALLS
(Please see section à Class: CL_GeneralIntegrationSettings).
• Request Url
o Title à CPQ-SFDC Request Url (Integration Reference)
o Description à API Url
• Request Body
o Title à CPQ-SFDC Request Body (Integration Reference)
o Description à Request payload
• Response
o Title à CPQ-SFDC Response (Integration Reference)
o Description à Response payload
Quote Messages
By default the integration will capture error messages from Salesforce and display them on the
Quote as a Quote Message.
62
Quote Message format: Integration Error - {integrationReference}: {Error}
Integration References
Integration references is the short abbreviated message that is attached to the logs and traces for
the integration. The reference can be used to understand what the API call is trying to achieve.
Below is a list of all the integration references used in the integration (List may be subject to
change).
63
Get Accounts API call that retrieves Get Accounts and API call that retrieves
and Contacts information on the Contacts information on the
Accounts and Contacts Accounts and Contacts
Create Quote API call that creates the Create Quote and API call that creates the
and Opportunity Salesforce Quote and Opportunity Salesforce Quote and
Opportunity Opportunity
Get Opportunity API call that retrieves the Get Opportunity Info API call that retrieves
Info Opportunity information the Opportunity
information
Send Generated API call that sends the Send Generated API call that sends the
Document to Generated Document to Document to Generated Document
Salesforce the Notes and Salesforce to the Notes and
Attachments section of Attachments section of
the Salesforce the Salesforce
Opportunity Opportunity
Get Account Info API call that retrieves the Get Account Info API call that retrieves
Account information the Account
information
Get Contacts API call that retrieves the Get Contacts Info API call that retrieves
Info Contacts information the Contacts
information
Assign Contacts API call that assigns Assign Contacts API call that assigns
contacts in Salesforce to contacts in Salesforce
the appropriate sObjects to the appropriate
as defined in mappings sObjects as defined in
mappings
Get Custom API call that retrieves Get Custom Objects API call that retrieves
Objects information on the information on the
defined Custom Objects defined Custom
(Please see section à Objects (Please see
Custom Object Mapping) section à Custom
Object Mapping)
Create/Update API call that Create/Update Custom API call that
Custom Objects creates/updates the Objects creates/updates the
custom objects (Please custom objects (Please
see section à Custom see section à Custom
Object Mapping) Object Mapping)
Get Opportunity API call that gets Get Opportunity API call that gets
Account Partner information for the Account Partner Role information for the
Role Account Opportunity Account Account Opportunity Account
Partner Role Account Partner Role Account
Create/Update API call that Create/Update Product API call that
Product Master creates/updates Product2 Master creates/updates
records on Salesforce Product2 records on
Salesforce
Create/Update API call that Create/Update Price API call that
Price Book creates/updates the Book creates/updates the
Salesforce Price Book Salesforce Price Book
Get Price Book API call that retrieves Get Price Book Entries API call that retrieves
Entries Price Book entries Price Book entries
64
SOQL This integration reference represents the SOQL API This integration
call generated from the use of the Global Script reference represents
CPQ_SF_QUERY_TAG (Please see section à the SOQL API call
Salesforce CTX Tags) generated from the use
of the Global Script
CPQ_SF_QUERY_TAG
(Please see section à
Salesforce CTX Tags)
Detach Quote API call that detaches the Detach Quote From API call that detaches
From Salesforce Quote from the Opportunity the Salesforce Quote
Opportunity Opportunity from the Opportunity
Get SObject Info API call that gets Get SObject Info API call that gets
information on a information on a
particular custom object particular custom
record object record
Post Quote API call that post the CPQ Post Quote Notes Into API call that post the
Notes Into Cart Comment into the Chatter CPQ Cart Comment
Chatter Salesforce Chatter into the Salesforce
(Opportunity/Opportunity Chatter
Account) (Opportunity/Opportun
ity Account)
Get records for API call that gets records Get records for Quote API call that gets
Quote Items to for a Custom Object Items to Custom records for a Custom
Custom Objects defined for Quote Item Objects Object defined for
mappings (Please see Quote Item mappings
section à Custom Object (Please see section à
Line-Item Mapping) Custom Object Line-
Item Mapping)
Send Quote API call that creates the Send Quote Items to API call that creates the
Items to Custom records based on the Custom Objects records based on the
Objects Custom Object Line-Item Custom Object Line-
Mapping Item Mapping
65
Deploying to other tenants
Below is a list of Global Scripts and Custom Actions that belong to the integration package. This
section describes which scripts are deployment sensitive and which ones are not. Scripts marked as
Deployment Sensitive need to be verified to ensure they do not require reconfiguration when
deploying to other tenants.
Quote 1.0
Global Scripts
Script Name Deployment Sensitive Deployment Info
CPQ_SF_FunctionModules No Script contains only logic,
can be deployed without
issues
CPQ_SF_IntegrationMessages No Script contains only logic,
can be deployed without
issues
CPQ_SF_IntegrationModules No Script contains only logic,
can be deployed without
issues
CPQ_SF_IntegrationReferences No Script contains only logic,
can be deployed without
issues
CPQ_SF_IntegrationSettings Yes If the integration features
and the Salesforce Objects
(Please refer to section
Integration Settings) differ
between your tenants.
Then this script must be
deployed and reconfigured
for the tenant.
CPQ_SF_LineItemModules No Script contains only logic,
can be deployed without
issues
CPQ_SF_OBJECT_TAG No Script contains only logic,
can be deployed without
issues
CPQ_SF_OnLandingFromCRM Yes If you have added Custom
code to this script which
differs between your
tenants. Then this script
must be deployed and
reconfigured for the
tenant.
CPQ_SF_OPP_TAG No Script contains only logic,
can be deployed without
issues
CPQ_SF_OpportunityLineItemMapping Yes If mapping differs between
your tenants. Then this
script must be deployed
and reconfigured for the
tenant.
66
CPQ_SF_OpportunityMapping Yes If mapping differs between
your tenants. Then this
script must be deployed
and reconfigured for the
tenant.
CPQ_SF_OpportunityStatusMapping Yes If mapping differs between
your tenants. Then this
script must be deployed
and reconfigured for the
tenant.
CPQ_SF_PriceBookMapping Yes If mapping differs between
your tenants. Then this
script must be deployed
and reconfigured for the
tenant.
CPQ_SF_QUERY_TAG No Script contains only logic,
can be deployed without
issues
CPQ_SF_QuoteMapping Yes If mapping differs between
your tenants. Then this
script must be deployed
and reconfigured for the
tenant.
CPQ_SF_ACCOUNT_TAG No Script contains only logic,
can be deployed without
issues
CPQ_SF_Configuration Yes This script is tenant
specific. It has to be
deployed and reconfigured
(Please see section
Configuration File).
CPQ_SF_ContactMapping Yes If mapping differs between
your tenants. Then this
script must be deployed
and reconfigured for the
tenant.
CPQ_SF_ContactModules No Script contains only logic,
can be deployed without
issues
CPQ_SF_CONTAINER_QUERY_TAG No Script contains only logic,
can be deployed without
issues
CPQ_SF_CpqHelper No Script contains only logic,
can be deployed without
issues
CPQ_SF_CreateQuote No Script contains only logic,
can be deployed without
issues
CPQ_SF_CreateUpdateOpportunity No Script contains only logic,
can be deployed without
issues
67
CPQ_SF_CustomerMapping Yes If mapping differs between
your tenants. Then this
script must be deployed
and reconfigured for the
tenant.
CPQ_SF_CustomerModules No Script contains only logic,
can be deployed without
issues
CPQ_SF_CustomObjectLineItemMapping Yes If mapping differs between
your tenants. Then this
script must be deployed
and reconfigured for the
tenant.
CPQ_SF_CustomObjectLineItemModules No Script contains only logic,
can be deployed without
issues
CPQ_SF_CustomObjectMapping Yes If mapping differs between
your tenants. Then this
script must be deployed
and reconfigured for the
tenant.
CPQ_SF_CustomObjectModules No Script contains only logic,
can be deployed without
issues
CPQ_SF_EditQuote No Script contains only logic,
can be deployed without
issues
CPQ_SF_ErrorHandler No Script contains only logic,
can be deployed without
issues
68
Custom Actions
Action Name Deployment Sensitive
Attach Salesforce Opportunity to Quote No
Create/Update Salesforce Objects From Quote Items No
Create/Update Salesforce Opportunity No
Detach From Salesforce Opportunity No
Post Quote Notes Into Salesforce Account Chatter No
Post Quote Notes Into Salesforce Opportunity No
Chatter
Reassign to Salesforce Opportunity No
Send Generated Document to Salesforce No
Quote 2.0
Global Scripts
Script Name Deployment Sensitive Deployment Info
CPQ_SF_PriceBookMapping Yes If mapping differs between
your tenants. Then this
script must be deployed
and reconfigured for the
tenant.
CPQ_SF_QUERY_TAG No Script contains only logic,
can be deployed without
issues
CPQ_SF_QuoteMapping Yes If mapping differs between
your tenants. Then this
script must be deployed
and reconfigured for the
tenant.
CPQ_SF_ACCOUNT_TAG No Script contains only logic,
can be deployed without
issues
CPQ_SF_BusinessPartnerMapping Yes If mapping differs between
your tenants. Then this
script must be deployed
and reconfigured for the
tenant.
CPQ_SF_BusinessPartnerModules No Script contains only logic,
can be deployed without
issues
CPQ_SF_Configuration Yes This script is tenant specific.
It has to be deployed and
reconfigured (Please see
section Configuration File).
CPQ_SF_ContactMapping Yes If mapping differs between
your tenants. Then this
script must be deployed
and reconfigured for the
tenant.
69
CPQ_SF_ContactModules No Script contains only logic,
can be deployed without
issues
CPQ_SF_CONTAINER_QUERY_TAG No Script contains only logic,
can be deployed without
issues
CPQ_SF_CpqHelper No Script contains only logic,
can be deployed without
issues
CPQ_SF_CreateQuote No Script contains only logic,
can be deployed without
issues
CPQ_SF_CreateUpdateOpportunity No Script contains only logic,
can be deployed without
issues
CPQ_SF_CustomObjectLineItemMapping Yes If mapping differs between
your tenants. Then this
script must be deployed
and reconfigured for the
tenant.
CPQ_SF_CustomObjectLineItemModules No Script contains only logic,
can be deployed without
issues
CPQ_SF_CustomObjectMapping Yes If mapping differs between
your tenants. Then this
script must be deployed
and reconfigured for the
tenant.
CPQ_SF_CustomObjectModules No Script contains only logic,
can be deployed without
issues
CPQ_SF_EditQuote No Script contains only logic,
can be deployed without
issues
CPQ_SF_ErrorHandler No Script contains only logic,
can be deployed without
issues
CPQ_SF_FunctionModules No Script contains only logic,
can be deployed without
issues
CPQ_SF_IntegrationMessages No Script contains only logic,
can be deployed without
issues
CPQ_SF_IntegrationModules No Script contains only logic,
can be deployed without
issues
CPQ_SF_IntegrationReferences No Script contains only logic,
can be deployed without
issues
CPQ_SF_IntegrationSettings Yes If the integration features
and the Salesforce Objects
70
(Please refer to section
Integration Settings) differ
between your tenants.
Then this script must be
deployed and reconfigured
for the tenant.
CPQ_SF_LineItemModules No Script contains only logic,
can be deployed without
issues
CPQ_SF_OBJECT_TAG No Script contains only logic,
can be deployed without
issues
CPQ_SF_OnLandingFromCRM Yes If you have added Custom
code to this script which
differs between your
tenants. Then this script
must be deployed and
reconfigured for the tenant.
CPQ_SF_OPP_TAG No Script contains only logic,
can be deployed without
issues
CPQ_SF_OpportunityLineItemMapping Yes If mapping differs between
your tenants. Then this
script must be deployed
and reconfigured for the
tenant.
CPQ_SF_OpportunityMapping Yes If mapping differs between
your tenants. Then this
script must be deployed
and reconfigured for the
tenant.
CPQ_SF_OpportunityStatusMapping Yes If mapping differs between
your tenants. Then this
script must be deployed
and reconfigured for the
tenant.
Custom Actions
Action Name Deployment Sensitive
Attach Salesforce Opportunity to Quote No
Create/Update Salesforce Objects From Quote Items No
Create/Update Salesforce Opportunity No
Detach From Salesforce Opportunity No
Post Quote Notes Into Salesforce Account Chatter No
Post Quote Notes Into Salesforce Opportunity No
Chatter
Reassign to Salesforce Opportunity No
Send Generated Document to Salesforce No
71
Custom Fields
Deploy Custom Fields:
- CPQ_SF_OPPORTUNITY_ID
- CPQ_SF_OPPORTUNITY_NAME
Before deploying to other tenant please check all the dependencies (SAP Help Portal - Deploying
Custom Fields).
Quote Tables
Deploy the Quote Table à CPQ_SF_QUOTE_CUSTOM_OBJECTS.
Before deploying to other tenant please check all the dependencies (SAP Help Portal - Deploying
Quote Tables).
Workflow
Recommended to configure manually if workflow differs per tenant.
SFDC Tags
Depending location and usage of Salesforce CTX tags (Salesforce CTX Tags & Salesforce Container
Tags), please deploy as per your own deployment guidelines.
72
Important Notes
• Please respect the accepted formatting when mapping with the Salesforce Date Fields
(https://developer.salesforce.com/docs/atlas.en-
us.api_rest.meta/api_rest/intro_valid_date_formats.htm)
• Do not send empty values for Date fields. Include a check in the script before mapping these
type of fields
• Status Codes and Error Responses (https://developer.salesforce.com/docs/atlas.en-
us.api_rest.meta/api_rest/errorcodes.htm)
• Leave parameter LOG_API_CALLS as inactive. Only activate if debugging is necessary. There
is a limitation on the amount of logs CPQ will capture for a specific Global Script
• Do not use the tag <*CTX( Quote.CurrentItem )*> in any of our mapping scripts.
The context Quote.CurrentItem (CTX Tag) does not exist within the scripts, it will always
return the value for the 1st item. Instead you should use the function parameter cpqItem if
available in the function. This parameter represents the IQuoteItem interface of an item.
73