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 CRM (Archived)

How to Save form using javascript in Dynamics 365?

(0) ShareShare
ReportReport
Posted on by

Hi People,

I am using "next stage" button in Business process flow,  with clicking next stage button i am setting optionset value.  But after saving once, it shows "unsaved changes". I have used "Xrm.Page.data.entity.save();". which is not working. Someone PLEASE help, its urgent.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    prt33k Profile Picture
    6,907 on at
    Are you doing something like this: 

    Xrm.Page.data.process.addOnStageChange(onStageChange); function onStageChange() { if(ExecutionContextObj.getEventArgs().getDirection()==="next") { // Set optionset value Xrm.Page.data.entity.save(); } }


  • Community Member Profile Picture
    on at

    yes

  • Community Member Profile Picture
    on at

    if(ExecutionContextObj.getEventArgs().getDirection()==="next")

     {

         // Set optionset value

         Xrm.Page.data.entity.save();

     }

    when i'm applying above stated code it is going in infinite loop of saving. i don't think this is going to work.

  • Suggested answer
    Community Member Profile Picture
    on at

    Try adding a flag. For example,

    var count = 0;

    if(count == 0)

    {

    //your code

    count ++;

    Xrm.Page.data.entity.save();

    }

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 CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans