0% found this document useful (0 votes)
75 views73 pages

Salesforce Integration - Configuration in CPQ

The document is an administration guide for integrating SAP CPQ with Salesforce, detailing configuration, authorization, and deployment processes. It includes sections on script deployment, custom actions, workflow permissions, and troubleshooting. The guide also outlines the setup of trusted applications and credential management for seamless integration between the two systems.

Uploaded by

291107jr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
75 views73 pages

Salesforce Integration - Configuration in CPQ

The document is an administration guide for integrating SAP CPQ with Salesforce, detailing configuration, authorization, and deployment processes. It includes sections on script deployment, custom actions, workflow permissions, and troubleshooting. The guide also outlines the setup of trusted applications and credential management for seamless integration between the two systems.

Uploaded by

291107jr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 73

SAP CPQ - SALESFORCE

INTEGRATION ADAPTER BY
CLARITY

SAP CPQ ADMINISTRATION GUIDE


Configuration in SAP CPQ
Table of Contents
Revision History .................................................................................................................................. 4
Authorization...................................................................................................................................... 5
Trusted Applications....................................................................................................................... 5
Credential Management ................................................................................................................ 5
Script Deployment Checklist .............................................................................................................. 6
Packages to Deploy for Quote 1.0 .................................................................................................. 6
Packages to Deploy for Quote 2.0 .................................................................................................. 8
Configuration.................................................................................................................................... 10
Quote Table .................................................................................................................................. 10
Custom Fields ............................................................................................................................... 11
Workflow ...................................................................................................................................... 12
Workflow Permissions .................................................................................................................. 13
Script Configuration ......................................................................................................................... 14
Initial Setup .................................................................................................................................. 14
Mapping ....................................................................................................................................... 21
Salesforce CTX Tags .......................................................................................................................... 55
Salesforce Container Tags ................................................................................................................ 57
Deactivate Standard CRM Integration.............................................................................................. 58
Custom Implementations ..................................................................................................................... 59
Troubleshooting ................................................................................................................................... 60
Developper Console ......................................................................................................................... 61
Custom Actions ............................................................................................................................ 61
Inbound Integration ..................................................................................................................... 61
Log .................................................................................................................................................... 62
Quote Messages ............................................................................................................................... 62
Integration References ..................................................................................................................... 63
Deploying to other tenants .................................................................................................................. 66
Quote 1.0...................................................................................................................................... 66
Quote 2.0...................................................................................................................................... 69
Custom Fields ................................................................................................................................... 72
Quote Tables .................................................................................................................................... 72
Workflow .......................................................................................................................................... 72

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.

Go to Setup à Security à Trusted Applications.

Add a new trusted application.

Set the following parameters:

• 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.

Go to Setup à Security à Credential Management.

Add the following entries:

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)

Script Deployment Checklist


After deploying the package to your Dev/Sandbox tenants. The below list of Global Scripts and
Custom Actions will be deployed on you tenant. This list should be used as a reference when
attempting to deploy to other tenants Qual/Prod.

Packages to Deploy for Quote 1.0

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

Packages to Deploy for Quote 2.0


Global Scripts
Script Name
CPQ_SF_PriceBookMapping
CPQ_SF_QUERY_TAG
CPQ_SF_QuoteMapping
CPQ_SF_ACCOUNT_TAG
CPQ_SF_BusinessPartnerMapping
CPQ_SF_BusinessPartnerModules
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_CustomObjectLineItemMapping
CPQ_SF_CustomObjectLineItemModules
CPQ_SF_CustomObjectMapping
CPQ_SF_CustomObjectModules
CPQ_SF_EditQuote
CPQ_SF_ErrorHandler
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

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.

Click Create Quote Table à CPQ_SF_QUOTE_CUSTOM_OBJECTS.

Define Columns the below columns as described in the screenshot below.

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.

Action Name Description


Attach Salesforce Opportunity to Quote This action:
- Attaches the Quote to the Opportunity from
which the user landed from when entering CPQ
from Salesforce
- Triggers all the inbound mappings (Salesforce
à CPQ)

Create/Update Salesforce Objects From Quote Items This action is used to Create/Update Salesforce Objects
based on the line items in the Quote.

Only the mappings that were previously defined in the


section CRM Item Mappings (Tab Create/Update
Custom SFDC Objects from Quote Items) will be
executed.

Refer to document section à Custom Object Line-Item


Mapping
Create/Update Salesforce Opportunity This custom action is the substitute of the standard
action Create/Update Opportunity.
The action triggers the outbound interface (CPQ à
Salesforce) which is responsible of updating the
Salesforce Opportunity and other related mapping
objects.
Detach From Salesforce Opportunity This custom action is the substitute of the standard
action Detach From Opportunity.
This action:
- Removes the Quote (All versions of the same
Quote) record on Salesforce
- Removes the Opportunity Name & ID from the
CPQ 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.

This script has 3 classes with parameters that need to be configured.

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

This parameter controls the integration


feature “Update existing products in
Salesforce when sending data from SAP
CPQ items”.
ATTACH_TO_OPP_IMMEDIATELY_ON_QUOTE_CREAT True/False
ED

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

This parameter controls the integration


feature “Quote object in CRM is NOT
deleted every time action
'Create/Update Opportunity' is
executed”.
DO_NOT_DELETE_CRM_QUOTE_ON_CREATE_UPDATE True/False

This parameter controls the integration


feature “All revisions from the quote will
be attached to the same opportunity”.
ALL_REV_ATTACHED_TO_SAME_OPPORTUNITY True/False

This parameter controls the integration


feature “Only one quote can be linked to
SF opportunity”.
SF_MCE Set this to TRUE if the customer is using
Multi-Currency on Salesforce.

Else set it to FALSE.


LOG_API_CALLS This parameter should remain set as
False.

It is used only when we want to debug


the integration. When set to True it logs
all the integration calls in the log just in
case the Dev Console is too crowded to
be able to capture the integration calls.
TAG_CACHING True/False

This parameter is set to True by default.

It is used in the TAG scripts (Please see


sections Salesforce CTX Tags &
Salesforce Container Tags for more
details on those scripts):
- CPQ_SF_ACCOUNT_TAG
- CPQ_SF_OPP_TAG
- CPQ_SF_OBJECT_TAG
- CPQ_SF_QUERY_TAG
- CPQ_SF_CONTAINER_QUERY_TA
G

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

When the parameter is set to False:


- When executing the TAG scripts
system will call Salesforce
everytime to retrieve the
appropriate information
requested

Use of this parameter in general is to


improve performance of the TAG scripts.

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.

It should normally be set to à


CPQ_SF_OPPORTUNITY_ID.

Do not change the default value.


OPPORTUNITY_NAME_FIELD Configure String of the Custom field
name used to store the Opportunity
Name.

It should normally be set to à


CPQ_SF_OPPORTUNITY_NAME.

Do not change the default value.

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.

This should normally be à Quote__c

18
SF_QUOTE_ID_FIELD Name of the Salesforce Quote ID field
in the Quote Object used by the client.

This should normally be à


Quote_ID__c
SF_OWNER_ID_FIELD Name of the Salesforce Owner ID field
in the Quote Object used by the client.

This should normally be à


Owner_ID__c
SF_QUOTE_NUMBER_FIELD Name of the Salesforce Quote Name
field in the Quote Object used by the
client.

This should normally be à Name


SF_PRIMARY_QUOTE_FIELD Name of the Salesforce Primary Quote
field in the Quote Object used by the
client.

This should normally be à Primary__c


SF_QUOTE_CURRENCY_FIELD Name of the Salesforce Currency Quote
field in the Quote Object used by the
client.
SF_QUOTE_OPPORTUNITY_FIELD Name of the Opportunity field that is
found on the Quote Object.

This should normally be à


Opportunity__c
SF_OPP_QUOTE_REL Name of the Opportunity Quote
relationship

This should normally be à Quotes__r


{Quote Object Name}s__r

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.

Mappings should be set in the function quote_integration_mapping.


This function exposes the Quote and TagParserQuote Interfaces for use in the mapping.
All mappings should be set in the dictionary salesforceQuote. The key should be equal to the API
field name in Salesforce. Below is an example of the mappings setup.

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.

Mappings should be defined in the function opportunity_status_mapping.


The list variable statusMappings stores all the status mappings, one entry represents one status
mapping between CPQ and Salesforce.
Use the dictionary mapping variable to fill the statusMappings list with the keys

- CPQ_STATUS à CPQ Status


- SF_STATUS à Salesforce Status

25
Price Book Mapping
Script name: CPQ_SF_PriceBookMapping

This script stores:

• The mapping of the Salesforce Custom Price Books with the SAP CPQ Market
• The Salesforce Id of the Standard Price Book

Please note that in most cases this mapping is usually empty.

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.

Outbound (SAP CPQ à Salesforce)


You should first define to which Salesforce Account the Customer Role needs to be mapped to when
the Create/Update Salesforce Opportunity custom action is triggered. This is defined in the class
CL_OutboundCustomerMapping.

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.

Inbound (Salesforce à SAP CPQ)


You should first define to which Salesforce Account the Customer Role needs to be mapped when a
Quote is created/edited from Salesforce. This is defined in the class CL_InboundCustomerMapping.

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.

Business Partner Mapping (Quote 2.0 Only)


Script name: CPQ_SF_BusinessPartnerMapping

This script file stores all the mappings involving the SAP CPQ Partner Function and Account object on
Salesforce.

Outbound (SAP CPQ à Salesforce)


We should first define to which Salesforce Account the SAP CPQ Partner Function needs to be
mapped to when Create/Update Salesforce Opportunity custom action is triggered. This is defined
in the class CL_OutboundBusinessPartnerMapping.

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:

- CpqPartnerFunction à The partner function code


- SalesforceAccount à The target Salesforce Account

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.

Inbound (Salesforce à SAP CPQ)


First, define to which Salesforce Account the SAP CPQ partner function needs to be mapped when
the quote is created/edited from Salesforce. This is defined in the class
CL_InboundBusinessPartnerMapping.

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:

- CpqPartnerFunction à The partner function code


- SalesforceAccount à The target Salesforce Account

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.

Outbound (SAP CPQ à Salesforce)


You should first define to which Salesforce Contact the SAP CPQ Customer Role needs to be mapped
when the Create/Update Salesforce Opportunity custom action is triggered. This is defined in the
class CL_OutboundContactMapping.

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.

Inbound (Salesforce à SAP CPQ)


You should first define to which Salesforce Contact the SAP CPQ Customer Role needs to be mapped
when a Quote is created/edited from Salesforce. This is defined in the class
CL_InboundContactMapping.

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.

Outbound (SAP CPQ à Salesforce)


You should first define to which Salesforce Contact the SAP CPQ Partner Function needs to be
mapped to when Create/Update Salesforce Opportunity custom action is triggered. This is defined in
the class CL_OutboundContactMapping.

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:

- CpqPartnerFunction à The partner function code


- SalesforceContact à The target Salesforce Contact

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.

Inbound (Salesforce à SAP CPQ)


You should first define to which Salesforce Contact the SAP CPQ Partner Function needs to be
mapped when a Quote is created/edited from Salesforce. This is defined in the class
CL_InboundContactMapping.

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:

- CpqPartnerFunction à The partner function code


- SalesforceContact à The target Salesforce Contact

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.

Custom Object Mapping


Script name: CPQ_SF_CustomObjectMapping

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

An object is either a Query object or Linked to Quote, it cannot be both.

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.

Inbound (Salesforce à SAP CPQ)


Function Description
on_quote_create_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
- CRM Object set to a custom object

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

Opportunity Account Bill To Role

Opportunity Account First Contact

Opportunity Account Partner Role Account

Opportunity Account Primary Contact

Opportunity Account Ship To Role

Opportunity Bill To Role

42
Opportunity Ship To Role

Opportunity First Role

Opportunity Partner Account First Contact

Opportunity Primary Role

Opportunity Partner Role Account

Opportunity Partner Role Account Bill To

Opportunity Partner Role Account Primary Contact

Opportunity Partner Role Account Ship To

Opportunity Partner Role Account End User

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.

Standard Object Code Snippet


Opportunity Account OpportunityAccount.py

Opportunity Account Bill To Role OpportunityAccountBillToRole.py

Opportunity Account First Contact OpportunityAccountFirstContact.py

Opportunity Account Partner Role OpportunityAccountPartnerRoleAccount.py


Account
Opportunity Account Primary Contact OpportunityAccountPrimaryContact.py

Opportunity Account Ship To Role OpportunityAccountShipToRole.py

Opportunity Bill To Role OpportunityBillToRole.py

Opportunity Ship To Role OpportunityShipToRole.py

Opportunity First Role OpportunityFirstRole.py

Opportunity Partner Account First OpportunityPartnerAccountFirstContact.py


Contact
Opportunity Primary Role OpportunityPrimaryRole.py

Opportunity Partner Role Account OpportunityPartnerRoleAccount.py

Opportunity Partner Role Account Bill OpportunityPartnerRoleAccountBillTo.py


To
Opportunity Partner Role Account OpportunityPartnerRoleAccountPrimaryContact.py
Primary Contact

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.

Inbound (SAP CPQ à Salesforce)


Function Description
on_quote_create_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
- 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_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 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_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 is not a custom
object and is not the Opportunity
Object

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)

Custom Object Line-Item Mapping


Script name: CPQ_SF_CustomObjectLineItemMapping

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:

- ObjectType à The technical name of the Salesforce Object


- Rank à Order at which the mapping should be executed

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:

• <*CTX( SFDC.Account )*>


• <*CTX( SFDC.CRMObject )*>
• <*CTX( SFDC.Opportunity )*>
• <*CTX( SFDC.Query )*>
• <*CTX( SFDC.QueryWithBrackets )*>

These tags could be located in the following places:

• Product rule condition or action


• Product Attribute Hints
• Product Attribute Labels
• Product Attribute Triggers
• Product Configuration Tab Visibility
• Container Attribute Column Calculation Formulas
• Container Attribute Validation Formulas
• Custom Fields
• Quote Item Custom Fields
• Custom Tables (less likely but possible as you can use custom tables to dynamically populate
rules, fields, etc.)
• Action Global Condition
• Workflow Conditions
• Required Fields by Workflow Action Condition
• Item Actions Workflow Conditions
• User Permissions Group Condition (advanced mode)
• Notification Conditions, Subject, and Message Body
• Approval Conditions, Descriptions, Custom Approver Selection Logic
• Quote Visibility Conditions
• Local Customer Visibility
• Global Customer Visibility
• Dictionary Visibility and Default Conditions
• Market Visibility and Default Conditions
• Shipping Method Visibility and Default Conditions
• Document Generation Visibility Conditions
• Document Generation Templates (this one we will not be able to query)
o CTX tags above can be parsed directly during document generation within a
<<C_TAG( )>> document tag

The Table below shows the list of Global Scripts that will be used to replace the SFDC Tags.

Global Script Description


CPQ_SF_ACCOUNT_TAG Used to retrieve fields from the Opportunity Account
CPQ_SF_OBJECT_TAG Used to retrieve fields from a defined Custom Object
CPQ_SF_OPP_TAG Used to retrieve fields from the Opportunity
CPQ_SF_QUERY_TAG Used to execute an SOQL Query and retrieve one selected field from
the result

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.

The SFDC Tags should be replaced as follows:

Standard Tag New Tag

<*CTX( SFDC.Account )*> <*CTX( Quote.ExecuteScript(CPQ_SF_ACCOUNT_TAG, {"PROPERTY":


"Salesforce Field Name"}) )*>

Parameters:
- PROPERTY: The technical salesforce field name

Example:
<*CTX( Quote.ExecuteScript(CPQ_SF_ACCOUNT_TAG, {"PROPERTY":
"Name"}) )*>

<*CTX( SFDC.CRMObject )*> <*CTX( Quote.ExecuteScript(CPQ_SF_OBJECT_TAG, {"OBJECT_NAME":


"Custom Object Name", "PROPERTY": "Salesforce Field 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"}) )*>

<*CTX( Quote.ExecuteScript(CPQ_SF_OPP_TAG, {"PROPERTY": "Salesforce


<*CTX( SFDC.Opportunity )*> Field Name"}) )*>

Parameters:
- PROPERTY: The technical salesforce field name

Example:
<*CTX( Quote.ExecuteScript(CPQ_SF_OPP_TAG, {"PROPERTY":
"Name"}) )*>

<*CTX( Quote.ExecuteScript(CPQ_SF_QUERY_TAG, {"QUERY": "SOQL


<*CTX( SFDC.Query )*> Query"}) )*>

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'"}) )*>

Note: By default, we retrieve the first field mentioned in the query.

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']"}) )*>

Salesforce Container Tags


We have the following tags that need to be modified to adapt to our new implementation:

• <*CTX( Container.LoadFromSFDC )*>


• <*CTX( Container.LoadFromSFDCQueryWithBrackets )*>

These tags should only be present in:

• Product rule action


• Product attribute triggers

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.

The tags should be replaced as follows:

Standard Tag New Tag

<*CTX( Container.LoadF <*CTX( Quote.ExecuteScript(CPQ_SF_CONTAINER_QUERY_TAG,


romSFDC )*> {"QUERY": "SOQL Query",
"CONTAINER": "Attribute Container Name"
"COLUMNS": "List of attribute Container Columns"}) )*>

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:

1. Go to Setup à CRM Integration à General


2. Set parameter CPQ is integrated with to à None

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).

SFEnvironment/Salesforce Replacement Code Snippets


Proxy
SFEnvironment.SfBaseUrl from CPQ_SF_Configuration import
CL_SalesforceSettings

url = CL_SalesforceSettings.SALESFORCE_URL

SFEnvironment.AdminSfUrl from CPQ_SF_Configuration import


CL_SalesforceSettings

url = CL_SalesforceSettings.SALESFORCE_URL

SFEnvironment.SfSessionId from CPQ_SF_IntegrationModules import


CL_SalesforceIntegrationModules

class_sf_integration_modules =
CL_SalesforceIntegrationModules(Quote,
TagParserQuote, None, Session)
# Get User Session
session =
class_sf_integration_modules.get_user_auth2_toke
n()

SFEnvironment.AdminSfSes from CPQ_SF_IntegrationModules import


sionId CL_SalesforceIntegrationModules

class_sf_integration_modules =
CL_SalesforceIntegrationModules(Quote,
TagParserQuote, None, Session)
# Get Admin Session
adminSession =
class_sf_integration_modules.get_admin_auth2_tok
en()

SFEnvironment.Opportunity from CPQ_SF_FunctionModules import


Id get_quote_opportunity_id
# Get Opportunity Id from Quote
oppId = get_quote_opportunity_id(Quote)
if not oppId:
# Get Opportunity Id from Session
oppId = Session["OpportunityId"]
SFEnvironment.Opportunity from CPQ_SF_FunctionModules import
.Id get_quote_opportunity_id
# Get Opportunity Id from Quote
oppId = get_quote_opportunity_id(Quote)
if not oppId:
# Get Opportunity Id from Session
oppId = Session["OpportunityId"]
SFEnvironment.Opportunity ScriptExecutor.Execute("CPQ_SF_ACCOUNT_TAG",
Account.Id {"PROPERTY": "Id"})

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.

Properties Replacement Code Snippets


Quote.OpportunityId Quote.GetCustomField("CPQ_SF_OPPORTUNITY_ID").C
ontent
Quote.OpportunityName Quote.GetCustomField("CPQ_SF_OPPORTUNITY_NAME")
.Content

Troubleshooting
After configuration of all the scripts and the setting up of the workflow. You can now proceed with
the testing of the integration.

To test and troubleshoot the integration you have 3 options:

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.

Filter Logger type à HttpWebClient.

You can view the requests and responses to identify issues.

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.

You can view the requests and responses to identify issues.

Log
To capture requests and responses in the CPQ log, please enable the parameter LOG_API_CALLS
(Please see section à Class: CL_GeneralIntegrationSettings).

Filter Title à CPQ-SFDC.

3 types of logs will be captured:

• 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}

- IntegrationReference à Short abbreviated description of what the integration is trying to


achieve
- Error à Error message received from Salesforce

To further troubleshoot it is recommended to either check the Log or Developper Console.

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).

Integration Description Integration Reference Description


Reference
Get Quotes API call responsible of Get Quotes Linked to API call responsible of
Linked to the getting all the quotes that the Opportunity getting all the quotes
Opportunity are linked to the that are linked to the
Opportunity of the Quote Opportunity of the
we are currently working Quote we are currently
on working on
Create API call that creates the Create Opportunity API call that creates the
Opportunity Line Opportunity Line Items on Line Items Opportunity Line Items
Items the Opportunity on the Opportunity
Get Salesforce API call that retrieves Get Salesforce Quote API call that retrieves
Quote searches for the searches for the
Salesforce Quote that is Salesforce Quote that
linked to the current CPQ is linked to the current
Quote CPQ Quote
Opportunity Line API call that retrieves Opportunity Line Items API call that retrieves
Items information on the information on the
current Opportunity Line current Opportunity
Items Line Items
Delete API call that deletes the Delete Opportunity API call that deletes the
Opportunity Line Opportunity Line Items on Line Items Opportunity Line Items
Items the Opportunity on the Opportunity
Create Accounts API call that Create Accounts API call that
creates/updates Accounts creates/updates
Accounts
Create Contacts API call that Create Contacts API call that
creates/updates Contacts creates/updates
Contacts
Update API call that updates the Update Opportunity API call that updates
Opportunity and Opportunity fields and and Make Quote the Opportunity fields
Make Quote sets the current Quote as Primary and sets the current
Primary Primary Quote as Primary
Opportunity API call that retrieves all Opportunity Partners API call that retrieves
Partners Opportunity Partners all Opportunity
Partners

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).

Recommended to be created manually to avoid dependency problems.

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).

Recommended to be created manually to avoid dependency problems.

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

You might also like