CPQ Javascript Calculator – Console.Log

cpqjavascript

I am working with the CPQ JavaScript Calculator. How do you see the debug logs? I mean it is running through as a Custom Script Record when running the CPQ UI. I looked through the pages with the Chrome debugging Tool but I am not seeing the Console.log outputs anywhere. I can see where it is calling the custom script but not the code.

export function onAfterCalculate(quote, lines, conn) {
 console.log('onAfterCalculate 4');
 return Promise.resolve();
}

Best Answer

I've found it easiest to add debugger; statements where I want to check out what my code is doing. If you open developer tools before clicking "Calculate", your browser will put a break point on that line. This lets you inspect values, etc.

export function onAfterCalculate(quote, lines, conn) {
 console.log('onAfterCalculate 4');
 debugger;
 return Promise.resolve();
}
Related Topic