I have a Call API button in an item details block. When the user presses it I want the API to be called (which works) but also for the page to navigate to /main. There are two buttons in this block and I only want this functionality for the button “Finalize Config”. Here’s the custom code I tried. I am a no-coder so someone provided this in this forum but it’s not working.
<script>
window.addEventListener('block-loaded-item-details1', () => {
window.addEventListener('update-record-success-item-details1', () => {
window.location.href = '/main';
});
});
</script>