Getting Data from Salesforce

1. Standard Objects and Fields - Account, Contact, Opportunity

  • SAP CPQ Setup»CRM Integration»Customer Role Mapping. To setup mapping, please go to Customer Roles Mapping
  • SAP CPQ Setup»CRM Integration»Custom Field Mappings. To setup mapping, please go to Custom Fields Mapping

2. Custom Objects and Fields

  • Use Setup»CRM Integration»CRM Objects to define the Salesforce object. See chapter on CRM Objects

A query can be defined to only use a subset of the object's data - for instance, only bring in Assets that are 30 days from renewal. Any objects that are defined here can then be used in any of the other mapping sections.


3. Using expressions

  • Use a CTX tag to populate data from salesforce
    • Pull from standard objects (Account, Opportunity,etc)
    • Pull from previously created CRM Objects (defined in #2)
    • Pull using a standard SF query (CTX.SFDCSalesforce.com.Query or CTX.SFDC.QueryWithBrackets)

If your query contains brackets (e.g. SELECT name FROM Account WHERE (AccountID='...') or (OwnerId='...')), then you should replace "(" and ")" with "[[" and "]]" respectively. This way, your SQL query will look like this: SELECT name FROM Account WHERE [[AccountID='...']] or [[OwnerId='...']] and will be parsed well by SAP CPQ before sending the query to Salesforce.

Additionally, there is an application parameter that can be set up by SAP CPQ support team where you can define a replacement for "(" and ")" brackets and use them instead of "[[" and "]]" brackets. Contact support if you need to change default replacement

4. CTX tag expression can then be used to load a container

  • Use CTX tag CTX.Container(…).LoadFromSFDC(SELECT Name,Description From Account WHERE AccountId='…').ToColumns(Col1, Col2, Col3) - Container column names do not need to match the names from the SF fields
  • Expression should be used in a Rule : Condition should NOT be 1 (unconditional)
  • If container should not be loaded until after a user makes a selction, then the condition will check for that selection
  • If the container should be loaded when the configuration first opens, then…
    1. Create a dummy attribute with a value that is preselected
    2. Check if the dummy attribute is selected for the condition of loading the container
    3. Create a rule at a higher rank that resets the dummy attribute

See Also

You are here: SAP Sales Cloud CPQ Online HelpBest PracticesCRM Integration SetupGetting Data from Salesforce