Existing Functionality: Currently we have three types of pricing Standard, A and B Standard: A: GPO pricing is maintained in price books B: B are created as accounts and pricing is manually loaded from SAP system using jitter bit when there is a update

Requirement: After we create the quote, when click 'edit lines' button we need to call the SAP system and get the pricing from SAP system based on type price book.

Can anyone please help me on what would be the best way to achieve the above mentioned requirement? Rest/SOAP api or lightning connect?

2 Answers 2


I'm not completely following your pricing scenario, but you can make an external call for pricing from the CPQ Quote Calculator Plugin. The Quote Calculator Plugin allows you to define a Custom Script that can then call Apex which then makes a rest call.

The important part is using the connection (conn) parameter in the CPQ custom script:

export function onAfterPriceRules(quote, lines, conn) {
  var body={< parametersPassedToRestFunction >};
  return conn.apex.post('/services/apexrest/restName/getPricing',body).then(function(res)
    if (res.success !== 'S')
       // successful result
    } else {
      // unsuccessful result
  return Promise.resolve();
return Promise.resolve();

< parametersPassedToRestFunction > are the parameters defined for your method in your Rest Class.

In my case, the variable res is a class defined within the Rest Class, so I can return lots of info.

Rest Class

global class restClass {
   global class dataClass {
     public String qtId;
     public String qtName;
     public String success;
     // more quote parameters
     public List<lineClass> myLines;

   global class lineClass {
     public String lineId;
     // more line parameters

   global static dataClass getPricing(dataClass myInfo) {
      // do rest call to external pricing and populate dataClass parameters
      // return dataClass


Hope this helps.



If you're still looking - enosix has an app specifically for integrating CPQ to SAP ERP for just this scenario - https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3A00000FvIwdUAF.

Disclaimer - I work for enosix.

  • Do you have any affiliation to enosix? Please make that clear in your answer as it is part of the Stack Exchange community standards.
    – Dave Humm
    Oct 20, 2020 at 14:48
  • Yes - sorry. Edited. Oct 23, 2020 at 13:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .