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)

CRM 2013: workflows set to execute on save are firing - what's the best strategy to overcome this?

(0) ShareShare
ReportReport
Posted on by 3,755

We have workflows that execute onSave. What it does is create a new record in a separate entity during the saving of a form. How do I overcome the limitation in CRM 2013, as I am aware that the record saves automatically every 10 - 15 seconds, so we'll end up having multiple records created. We're also taking a huge performance hit.

Any ideas?

*This post is locked for comments

I have the same question (0)
  • Peter Hale - QLD Profile Picture
    480 on at

    You can turn autosave off

  • Suggested answer
    jlattimer Profile Picture
    24,562 on at

    Like Peter mentioned, you could turn off auto save or you could add additional check conditions to your workflow to ensure it only fires once.

  • Hussman Profile Picture
    3,755 on at

    Thanks guys, trying to workout what the logic would be in a workflow to trigger only once when out of the form. Any ideas?

  • jlattimer Profile Picture
    24,562 on at

    Really depends on what you are doing. A potential option is to create an additional boolean field to indicate your new record has been created or not. In the workflow once you've created the new record set the field to true. Include a check condition in the beginning of the workflow to only run if the value is false.

  • Thomas Unzeitig Profile Picture
    364 on at

    I think the only option for you is to turn autosave off.

    if you want to turn it off only in one entity use this code:

    soho.at/.../microsoft-dynamics-crm-2013-prevent-a-record-from-being-saved

  • AndrewCampey Profile Picture
    on at

    When you say "create a new record in a separate entity during the saving of a form" what are the conditions on this?

    I would have thought that you could do the Workflow when the record is created. Otherwise set the workflow to start only when a particular field changes.

    If you can restrict when the workflow starts then the performance hit/auto save should be irrelevant I would have thought.

  • Suggested answer
    Anjali Raj Profile Picture
    on at

    Hussman,

    Since the Save event triggers on both auto save and explicit save, a way has been provided to differentiate whether the Save event is being triggered by autoSave or explicit save. A new "Auto Save" mode with an unique value of 70 has been added to the CRM SDK so that the getSaveMode() can return a specific value for ISVs to use. Refer to CRM 2013 SDK for more information about the existing method in CRM 2011.

    If you want to enable auto save for your organization but disable it for specific entity forms, you can add code to the OnSave event to prevent auto save from occurring for that form only.You can use function preventAutoSave(econtext) and add it as web resource for that specific form.

    Refer - http://msdn.microsoft.com/en-us/library/gg509060.aspx#BKMK_GetSaveMode

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