Announcements
Hi All,
I have implemented a dialog box in dynamics 365 crm which appears based on some business condition when user saves the form. In the dialog box i have given user only one option to refresh the form and everything is working fine until here as designed.
But as soon as the user hits on the refresh button the system shows and unsaved change dialog box which have two options "save and continue" and "discard". If the user hits on discard my form is refreshed but if user hits on the save and continue option then the refresh dialog box will again pop-up and it will continue ti be in the same loop until the user clicks on discard option.
I want to give the user ability to discard the changes and refresh the form when they hit on the refresh options in the dialog box and so they won't have to make a choice between save and continue or discard. They can directly click on refresh button to discard the changes and refresh the page so they get the latest changes.
I want to implement this discard and refresh code in javascript. So, kindly help me out with this if there is any possible way to perform this.
Thanks in advance!!
Regards,
Shiv
This is only giving me options to get the list of dirty field and it doesn't allow my changes to get discarded.
I don't want to save the unsaved data, i want to discard the changes and then refresh the form. I don't have the code to discard all unsaved data.
Hi,
Write below code before you refresh your form from javascript
formContext.data.entity.save();
For some reason i cannot share the code with you. I just want the ability to discard unsaved changes and refresh the form. so i don't see the unsaved changes dialog box.
Hi ShivAgrawal,
Could you share code you have written and screenshots?
André Arnaud de Cal... 291,359 Super User 2024 Season 2
Martin Dráb 230,370 Most Valuable Professional
nmaenpaa 101,156