While the Epicor CPQ managed package for Salesforce provides a fully featured integration, some customers need more customization. Perhaps your company doesn't use opportunities, or perhaps you use your own custom objects instead of the built-in SFDC objects. Here's some guidance and examples. (If you want a basic overview before getting into specific examples, first read the page on Salesforce Snap Blocks.)
If you don't use SFDC Opportunities
No worries. The Epicor CPQ quote object in SFDC is an independent object. It can also work without opportunities with all the same features. You can simply navigate to the 'Quotes' page in SFDC (or add a permanent tab for this), add a new quote, and the rest of the user flow remains the same.
If you want Epicor CPQ to update your own custom fields on the SFDC quote object
Sometimes you want to update your own custom fields of data on the Epicor CPQ Quote object in SFDC so those custom fields are populated and can be included in your Salesforce reports.
- As a Salesforce administrator, in the setup area,
navigate to Create > Objects, and select the object you would like to add a custom field to. Refer to the SFDC help on how to create a custom field of a certain type. For example, create a custom text field called "My custom field" on the "KBMax Quote" object in Salesforce. The Salesforce API name for this new field would therefore be "My_custom_field__c". As usual in Salesforce, ensure your custom field is usable: ensure the right Salesforce users can read/write to it, place it onto the necessary Salesforce page layouts, and add it to a Salesforce ReportType so it can appear in reports.
- Then as a Epicor CPQ administrator, in a Epicor CPQ SNAP workflow or output rule,
add a snap rule that will set your custom field at a specific point in your workflow. Below is an example rule that sets this custom field on the Epicor CPQ quote object in salesforce, called "KBMax__quote__c". See here to learn more about how you can control SFDC with Snap.
If you want Epicor CPQ to update any other field on any other object in SFDC
If you want to update information into other Salesforce objects, you can do so in a Build rule or a Workflow rule. However, as with any update into a Salesforce object, you must first know the ID of your target object, and pass that ID in as a key to your update or deletion. Salesforce uses this key to find the correct record: without an ID, Salesforce cannot perform any update/delete.
The "Epicor CPQ for Salesforce Sales Cloud CRM" package uses a custom object, called "KBMax__quote__c", for integrating data into Salesforce. We keep track of the ID on that object for you as part of the integration. You can find that ID in the "get" block, as the quote attribute "ExternalID". For quotes that are not integrated to Salesforce, this field is null.
For example, in the screenshot above, we are writing information into a specific "KBMax__quote__c" identified by the value in the get block: "quote externalID". This value is set automatically by the integration. But the IDs of other objects – like the parent opportunity of the quote, or the parent account of the opportunity – are not set. These are your responsibility to gather. Don't worry: you can do that in Epicor CPQ Snap.
Here's an example of a Safe Function using the known Quote ID to traverse across a series of objects in the Salesforce ERD to another related object. (This safe function would be called from a Build or Workflow rule only.)
The example here is simply reading the value of a Salesforce field called "Sales_Market__c" on the Account object. Because the result Salesforce gives from this example query is complex, we use the structures of arrays and maps to drill down into the result until we get to the data we want. Depending on the query you send in to Salesforce, the result you get back may have similar complexity. Printing out the Salesforce Client result object as a JSON string can give you insight into the structure of the data you need to parse.
Combine this technique to gather the ID of the item you want to modify, and the technique shown in the previous screenshot to write information to Salesforce using a given ID, to write to any traversable object in Salesforce during a Build or Workflow rule. See here to learn more about how you can control SFDC with Snap.
If you want to pass Salesforce data into your configurator as it launches
You may want to pass some information from Salesforce into Epicor CPQ. For example, you could...
- Use the Salesforce opportunity's close date in your Epicor CPQ pricing rules.
- Use the Salesforce user's title, department, and division to appear in your Epicor CPQ output document.
- Use the Salesforce opportunity's primary contact's language to control the localization of your Epicor CPQ output document.
You can gather information from Salesforce at the moment your user "punches out" to Epicor CPQ as parameters, and pass those parameters to the configurator. Once that data is stored in your configurator, it's easy to use anywhere else in Epicor CPQ. Here's how.
Salesforce passes data to Epicor CPQ
- Log in to Salesforce as an administrator.
- Create a new Apex class (like the one in the next example).
- In the class, perform as may queries as you like to gather the information you need. You're only limited by the SOQL you write in your Apex class.
- Go to Setup > Platform Tools > Apps > App Manager. You'll see a list called "Lightning Experience App Manager".
- Find the connected app named "KBMax CPQ", and edit it.
- In the Canvas App Settings, select the apex class you created.
Epicor CPQ stores data from Salesforce
- Log in to Epicor CPQ as a company administrator.
- In the administrative interface, edit the configurator you're using in the Salesforce integration.
- For each parameter you would like to capture, create a field in the configurator.
- Create a "Loaded Rule" in the configurator to pull information out of the parameters object only once: when it is first loaded. The parameters object is a map of key/value pairs. For example, in the screenshot below we
- place the value of inbound parameter "param1" into the configurator text field "ThisParam".
- place the value of inbound parameter "param2" into the configurator text field "ThatParam".
If you want your user to return to a different place when your configurator closes
By default, your user "punches out" from a Salesforce object on their screen to the KBMax Quote page, and then they return to that same salesforce object when they press "Done" in the KBMax Quote page. If you want your user to return to another object (for example, the parent Opportunity for that quote), then Salesforce requires a custom CanvasLifecycleHandler to be built. In that handler, set a parameter named "navigateTo" with the ID of the Salesforce object to navigate to when the "Done" button is pressed.
If you aren't using a CanvasLifecycleHandler already (e.g. for passing custom parameters into Epicor CPQ), you can use the one below as-is.
After you create and save your Apex class, remember to...
- select it in the Canvas App Settings of the KBMax CPQ Connected App.
If you don't want Opportunity LineItems to be automatically updated
Before the Epicor CPQ package is installed, you'll remember the default behavior of Salesforce: opportunity lines are automatically updated to match the quote lines of the opportunity's primary quote. This minimizes manual work and helps ensure the opportunity value is accurate for pipeline reports.
By default, the Epicor CPQ package mimics that standard salesforce behavior. When Epicor CPQ writes the Epicor CPQ quote line items back to the KBMax quote object, a matching set of opportunity line items are written back to the KBMax quote's parent opportunity. If you do not want this standard functionality, and want the Opportunity Line Items to be untouched, you can turn this feature off.
- Log in as a Salesforce administrator.
- Visit Admin > Custom Code > Custom Settings.
- Find "KBMax CPQ Settings" in the list, and click "Manage".
- If you see an empty list, click "New" to create a new KBMax CPQ Settings document.
- If you see a settings document, click "Edit" to edit it.
- By default, Epicor CPQ will auto-create opportunity line items.
To turn the feature off, clear the checkmark next to that option and save your settings.
If you need to set up a named credential
Some customizations may need you to set up a named credential so Salesforce and Epicor CPQ can communicate more broadly. For example, if you want to be able to clone an Epicor CPQ quote from a Salesforce button.
Setting up a named credential can help resolve salesforce Apex runtime errors like "The callout couldn't access the endpoint. You might not have the required permissions, or the named credential "Foo" might not exist." or "no content to map to Object due to end of input."
Follow these steps to set up a named credential for a callout endpoint:
- Log in as a Salesforce administrator.
- Visit Setup > Security > Named Credentials.
- Find "KBMax CPQ Settings" in the list, and click "Manage".
- If you see an empty list, click "New" to create a new Epicor CPQ named credential.
- If you see entries in the list, look for an entry called "KBMax", and edit it if it already exists. Do not create two named credentials with the same name.
- Enter the following settings:
- URL should be the path to your Epicor CPQ instance: ensure you have the org name and environment (-dev, -text, or nothing) typed correctly.
- Username and Password should be the credentials of a Epicor CPQ user who has rights within Epicor CPQ to perform the operations you need. Salesforce will log in to Epicor CPQ's API as this user. We suggest as best practice to have this named credential be the same as the Epicor CPQ superuser account you created and used in the basic setup of your salesforce integration. It should not be the account of an individual user: that can cause integration problems in the future.
- All other fields can be left as shown.