0

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?

0

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

@RestResource(UrlMapping='/restName/*')
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
   }

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

}

Hope this helps.

Mike

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.