If you’re here you’re eagerly trying to figure out how to update Quote Line Group values in a price rule. Unfortunately, you can’t. Yet. But you can in a QCP! Here’s a basic sample that copies the Quote Account value into the Quote Line Group Account field.
//QuoteCalculatorJS
export function onAfterCalculate(quote, lines, conn) {
quote.groups.forEach(function(group) {
if (group.record != null) {
group.record['SBQQ__Account__c'] = quote.record['SBQQ__Account__c'];
}
});
return Promise.resolve();
}
Hi,
I need to update the guote line group fields header values based on quote line in that particular group.
for example: i have to update one time total field on the group header.if the charge type of the Quote line is one time the it should sum up the quoteline and update it.
Hi Manusha! Yes you can do this! You would need to loop through your groups, then inside that loop, loop through your lines to gather line values and do some if statement testing of data for your specific criteria. If the criteria hits, set the values in the group!
Hi D P,
Great stuff.Keep rocking.
Do you know if QCP gets triggered when a value is updated from a trigger/process ?
I need to vet this out but I do believe it does.
Hi
I have a scenario where i have multiple QLG on a Quote and I would need a way to add product A to all QLG at once. how can we achieve this ?
This would need to be a custom solution using apex.