I am facing an issue with displaying a custom message when a workflow is completed. My requirement is to show a message after a user clicks a button on the Account form. The button triggers a JavaScript function that calls a workflow to create an Order. While the workflow runs and creates the order without any issues, I am having trouble displaying the custom message 'Order Created Successfully' once the workflow has finished. But the progress indicator 'Creating Order' correctly displays until the workflow runs.
Below is my JavaScript code. Could you please review it and let me know where I might be going wrong and what changes are needed to show the custom message based on the workflow status or when the progress indicator disappears?
Thank you for your assistance. Attached the JS script
Thanks
Gowtham