Hi Team,
I have a requirement which i need to be done by Plugin.
There have a Account Record and when i open that Account Record and modify some of the fields and click on Save then the Record should not gets Saved.
Instead it shows Some Custom Message that " New record gets Created" and create a New Record with that updated details.
I need to do this using Plugin. Can anybody give me any solution that how should i proceed and achieve the same.
Thanks in Advanced.
Hello,
you can use this :
1- Create a javascript funtion
2- pass to it the execution context as shown below
3- Associate your function to Onsave event
4- execContext.getEventArgs().preventDefault(); // To Prevent the Form Save
Hope this helps
You can achieve this by blocking the save (onSave javascript handler) and invoking a custom Action with a plugin attached to create the record, passing all the account fields to the Action. After the action completes and you are back in your JS you can display the alert and/or navigate to the new record.
On a side note, this sounds like an excellent way of filling up the accounts with a boatload of duplicates, each differing by only a typo and devoid of any value. If I were you I'd prepare to delete and rework the whole thing in a matter of weeks.
Hi,
As I know you can just throw exception in Update or Create event.
throw new InvalidPluginExecutionException("The record can't be saved")
Hi,
Do you really need to do this by plugin? I know that with javascript this is achievable, by plugin I don't think so.... Unless you throw an exception on plugin, on pre update event (but this is not a very "pretty" solution, neither throwing an exception).
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156