Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Form is saving changes twice

(0) ShareShare
ReportReport
Posted on by 1,326

When updating a field on Opportunities and looking in the audit history, the change seems to be saving twice, and therefore it is firing an email workflow twice. For some reason this does not happen every time. Anyone know why? I did notice that when it does happen, the form refreshes immediately after I click save. 

I also do not have any Javascript on the OnSave event, only OnCreate. 

We have Auto-Save enabled but I also added the Save button to the ribbon, which I thought might cause this. But this has happened when using this button and the Save diskette at the bottom right.

8463.Capture.PNG

*This post is locked for comments

  • Arun_CRM Profile Picture
    15 on at
    RE: Form is saving changes twice

    Hi Goutam,this answer saved a day Thanks and appreciate!!

  • gdas Profile Picture
    50,089 Moderator on at
    RE: Form is saving changes twice

    In your custom plugin are you updating opportunity record ?

    The depth check is nothing but its a  context property which is handle infinite loop. Let say you have registered a plugin in post update event of opportunity , and inside plugin you are making another update request , so your plugin will fire again and again due to ufor that update request.

    To  avoid this we need to check the depth of the plugin .

    IPluginExecutionContext context = localContext.PluginExecutionContext;

    if (context.Depth > 1)

        return;

    For more information please refer below-

    crmbusiness.wordpress.com/.../stopping-infinite-plugins-with-parameters-depth-and-parentcontext

    You can deactivate   "ActivityFeeds.Plugins.OpportunityUpdate: Update of opportunity for ProbabilityUpdate" step  to check whether its making impact or not . If its not then you can enable it again.

  • epark06 Profile Picture
    1,326 on at
    RE: Form is saving changes twice

    [quote user="Goutam Das"]

    I am not sure what customization you did for Opportunities entity  , however check following things -

    - Is there any On Save function registered  in form level.

    - Need to check your code , is there any Xrm.Page.data.entity.save() you have write in your code which is firing in onsave event.

    - Go to settings -> Customization --> Customize the System --> SDK Message Processing , check any plugin step registered for this entity.

    - Make sure you have used depth check in your plugin if you have any.

    - Try to disabled auto save , form on save event and disable all plugin step and test .

    Hope this helps.

    [/quote]

    -We have no On Save function registered on the form.

    -We have two Post-Operation Update steps registered on the Opportunity, one of which is a custom plugin which I prefer not altering. The other is "ActivityFeeds.Plugins.OpportunityUpdate: Update of opportunity for ProbabilityUpdate" - do you know what this does and if I can safely disable it?

    -I do not know what depth check is.

  • Verified answer
    gdas Profile Picture
    50,089 Moderator on at
    RE: Form is saving changes twice

    I am not sure what customization you did for Opportunities entity  , however check following things -

    - Is there any On Save function registered  in form level.

    - Need to check your code , is there any Xrm.Page.data.entity.save() you have write in your code which is firing in onsave event.

    - Go to settings -> Customization --> Customize the System --> SDK Message Processing , check any plugin step registered for this entity.

    - Make sure you have used depth check in your plugin if you have any.

    - Try to disabled auto save , form on save event and disable all plugin step and test .

    Hope this helps.

  • Suggested answer
    Temmy Wahyu Raharjo Profile Picture
    2,914 on at
    RE: Form is saving changes twice

    Hi,

    This issue might because of your customization. Please check is there any customization either plugin or javascript. Maybe the plugin runs on PostOperation then update again the current record. Then it invoke again the same workflow.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,261 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 233,013 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans