web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

Only run script after Create?

(0) ShareShare
ReportReport
Posted on by 99

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.

I have the same question (0)
  • Suggested answer
    Torrado Profile Picture
    1,270 on at

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Siv Sagar Profile Picture

Siv Sagar 93 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 80

#3
Martin Dráb Profile Picture

Martin Dráb 64 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans