Hi HimaM,
I'm so glad to hear that you have resolved your problem and thank you very much for sharing the solutions.
Best Regards,
Leo
Hi Leo & David,
My requirement was not possible using alert messages so i created a HTML webresource with the messages for won and lost and enabled these using JS using setVisible condition when the opportunity is won or lost.
Thank you for your suggestions.
Have a good day.
Regards,
Hima
Hi HimaM,
I tried many ways to do this but both of them didn't work.
1. I created a custom field first named "new_copyStatus" and then I created a workflow to set the "new_copyStatus" field value to "Won" when winning the opportunity.
Then I add a js code to alert the message to the "Onchange" event of "new_copyStatus" field on the opportunity form. But after a test, it didn't work :(.
So we know that if we update the field through workflow, it will not trigger the "Onchange" event on the form.
2. I added a js code to judge if the status is "Won", then alert the message when onloading the form because I find that when the opportunity finish the win process, the page will be reloaded. I tried this function but it still did not work. Then I found that when the opportunity finish the process and reload the page, it only do asynchronous update, not Synchronous which means it will not refresh the form so that the function of form "Onload" will not be triggered.
I think that the "Win" process is a workflow which works in the background, but showing message on the form could only be done by js code. We could not trigger js code through workflows. So I'm sorry that there doesn't seem to be a way out right now.
Hope it helps.
Best Regards,
Leo
One option would be for the plugin to write the message to a custom text field that is hidden on the form, and to create a javascript function on the onload event to read this message and alert the user
André Arnaud de Cal... 291,622 Super User 2024 Season 2
Martin Dráb 230,354 Most Valuable Professional
nmaenpaa 101,156