Khadim Ali
Khadim Ali

Reputation: 2598

Capturing an after save event

Is there any way I can execute some JavaScript code after the Dynamics CRM entity form is saved. The available OnSave event fires before the form is saved actually.

What I want to do is: to get the newly created record's id and set it on the lookup field on the opener window. For this I have:

NOTE: I am not using the built-in lookup here because I have to pass some data from the opener window to over the new record.

Upvotes: 0

Views: 3207

Answers (2)

ironarm
ironarm

Reputation: 472

There is now: addMessageToOnPostSave

https://learn.microsoft.com/en-us/power-apps/developer/model-driven-apps/clientapi/reference/formcontext-data-entity/addonpostsave

Back then, there was no reliable way. Keeping track of the formType changing from 1 to 2, or onchange, none of that works if they click Save & Close.

Upvotes: 1

Adrian Sayasane
Adrian Sayasane

Reputation: 11

You could attach your JavaScript function onto the OnChange event of the Modified date field.

This field will update after the form is saved.

Upvotes: 1

Related Questions