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

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

Unsaved changes showing after opening lead record in crm 365 online

(0) ShareShare
ReportReport
Posted on by 2,667

Hi All,

I am getting unsaved changes on the lead form I have checked with below code to get dirty fields

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

And Got <lead><new_lead_status1>799240001</new_lead_status1></lead>'

When i have checked script there we are setting this field value on chnge of other field & on load, on save also.

What could be the solution we can do so that these unsaved changes could go away.

pastedimage1651679262550v1.png

Thanks,

Jharana

I have the same question (0)
  • Suggested answer
    Bipin D365 Profile Picture
    28,983 Moderator on at
    RE: Unsaved changes showing after opening lead record in crm 365 online

    Hi,

    Do you really need to set this field value on onload event ?

    Have you tried disabling onload event where you are setting this field value to see if it works?

    Thanks,

    Bipin

  • Jharana Baliyar Singh Profile Picture
    2,667 on at
    RE: Unsaved changes showing after opening lead record in crm 365 online

    Hi Bipin,

    Yes we dont  need onload or on save only on change field it should be enough.

    And when i disable onload event then unsaved changes not showing.

    My doubt is is it the correct thing to do for removing unsaved chnages ?

    Thanks,

    Jharana

  • Suggested answer
    Bipin D365 Profile Picture
    28,983 Moderator on at
    RE: Unsaved changes showing after opening lead record in crm 365 online

    Hi,

    Only on change should be enough for your requirement to set other field value.

    Unsaved changes comes because you are setting some field value on onload and user is trying to navigate to different page without saving.

    You can also try to save the record after setting the field value on onload event using javascript

    Xrm.data.save

    Thanks,

    Bipin

  • Jharana Baliyar Singh Profile Picture
    2,667 on at
    RE: Unsaved changes showing after opening lead record in crm 365 online

    Hi Bipin thanks for your response.

    Tried with form save explicitly formContext.data.save but even though it didn't removed showing unsaved changes.After removing onload event it worked.

    Thanks,

    Jharana

  • Suggested answer
    Bipin D365 Profile Picture
    28,983 Moderator on at
    RE: Unsaved changes showing after opening lead record in crm 365 online

    Hi,

    Do you really need onload event, if yes then I will have to check other options ?

    Thanks,

    Bipin

  • Jharana Baliyar Singh Profile Picture
    2,667 on at
    RE: Unsaved changes showing after opening lead record in crm 365 online

    Hi Bipin,

    No onload event we dont need as its setting some field value on chnage of other field.

    I am working on it I am getting some other fields also in dirty check below.

    Where ever field is trying set some field value there am calling Xrm.data.save

    <lead><new_sitepotentialbags>300</new_sitepotentialbags><statuscode>799240010</statuscode></lead>'

    <lead><new_brandused></new_brandused>

    <new_sitepotentialbags>300</new_sitepotentialbags>

    <new_balancerequirementbags></new_balancerequirementbags>

    <statuscode>799240010</statuscode></lead>'

    Thanks,

    Jharana

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 127

#1
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 127

#3
Tom_Gioielli Profile Picture

Tom_Gioielli 125 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans