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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Customer Service forum

How to remove unsaved changes notification near save button.

(0) ShareShare
ReportReport
Posted on by

Hi people,

I was working on Business process flow automation. I am having one optionset field which holds the same options as I am having the stages in BPF.  I had to write script for automatic change of field's optionset value according to stage of Business Process Flow. So when I am clicking on "next stage" button, the field is changing but the unsaved changes notification is still there. this I am unable to remove. Can anybody suggest any effective method to achieve that. I am using below code:

function mainFunc()

{

Xrm.Page.data.process.addOnStageChange(StateChanged);

}

function StateChanged() {

var selectedStage = Xrm.Page.data.process.getSelectedStage().getName();

var stage1 = 100000000;

var stage2 = 100000001;

var stage3 = 100000002;

 

if (selectedStage == "Stage1") {

Xrm.Page.getAttribute("new_pipelinephase").setValue(stage1);

}

if (selectedStage == "Stage2") {

Xrm.Page.getAttribute("new_pipelinephase").setValue(stage2);

}

if (selectedStage == "Stage3") {

Xrm.Page.getAttribute("new_pipelinephase").setValue(stage3);

}

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

}

Here new_pipelinephase is the schema name of optionset field.

Categories:
I have the same question (0)

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

News and Announcements

Season of Giving Solutions is Here!

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Customer Service

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans