Error: trigger the automatic push of the button after the press of anothe
Summary:
Content (please ensure you mask any confidential information):
Hello,
We are trying to trigger the automatic push of the button after the press of another. In order to to it we use this code that is taken from the guide associated to CPQ js (https://help.bigmachines.com/BMIHelp/Default.htm#Style_Templates/JavaCustomization.htm?Highlight=cpqjs):
<script>
function updateVoucher(){
console.log("Eseguo applyVoucher");
CPQJS.performAction('STAUBLI_ApplyVoucher_c');
};
setTimeout(function(){
CPQJS.onActionComplete('_update_line_items', updateVoucher);
},1);
</script>
However, it doesn't work, the following error is shown:
transactionMain.js?v=2024605280644:43582 Uncaught (in promise)
TypeError: Cannot read properties of undefined (reading 'then') at transactionMain.js?v…4605280644:43582:33 at new Promise (<anonymous>) at Object.performAction (transactionMain.js?v…4605280644:43581:20) at updateVoucher (<anonymous>:5:9) at ButtonLigAction.handleEvent (transactionMain.js?v…4605280644:43625:17) at ButtonLigAction.dispatchEvent (transactionMain.js?v…4605280644:4228:654) at triggerHarmlessEvent (transactionMain.js?v…4605280644:33138:27) at ButtonLigAction.<anonymous> (transactionMain.js?v…4605280644:33064:21)