Is there a way to run my JScript only after the Create / First time save? I thought the "CreatedOn" field would have a OnChange but it does not.
Is there a way to run my JScript only after the Create / First time save? I thought the "CreatedOn" field would have a OnChange but it does not.
Hello Myke,
You can create a variable (e.g. runPostCreateLogic) to control OnLoad if your Post-Create logic should run or not.
function onSave() {
If (formType == 1) {
// If Form Type is Create, set the variable as true
runPostCreateLogic = true;
}
}
function onLoad() {
If (runPostCreateLogic == true) {
// Run your Post-Create logic here
}
}
Please also check the following post, as example: https://community.dynamics.com/crm/f/microsoft-dynamics-crm-forum/299660/javascript-run-code-after-save
Hope this helps you.
Please mark the answer as verified if helpful. That will help others in future.
André Arnaud de Cal... 291,642 Super User 2024 Season 2
Martin Dráb 230,371 Most Valuable Professional
nmaenpaa 101,156