We have a scenario that sometimes in CPQ, the ghost quotes which gets created does not automatically gets deleted because the internal CPQ calculation fails. https://help.salesforce.com/articleView?id=000316738&type=1&language=en_US&mode=1
To triggered a recalculation of Quotes we are just doing a dummy updates on such quotes.
List<SBQQ__QuoteLine__c> quoteLines = [SELECT Id,SBQQ__AdditionalDiscountAmount__c FROM SBQQ__QuoteLine__c WHERE SBQQ__Quote__c = 'QuoteId'];
if(!quoteLines.isEmpty()){
quoteLines.get(0).SBQQ__AdditionalDiscountAmount__c = quoteLines.get(0).SBQQ__AdditionalDiscountAmount__c;
}
update quoteLines;
and the CPQ recalculation gets triggered internally. But how to verify that the recalculation is success, is there a way? Or we just add all Quote Line Items amount and verify if Opportunity Amount matches this.
UDPATE (Just trying with Calculate API but : not working)
When using Calculate API, I am getting this error:
08:07:35.852 (9852147514)|EXCEPTION_THROWN|[438]|System.SObjectException: SObject row was retrieved via SOQL without querying the requested field: Product2.SBQQ__PricingGuidance__c
Though the handler gets called successfully, I have no idea how to pass this as I am not using any query to feed Quote. I am using read api to read the Quote using Id.