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 enable auto save on a form

(0) ShareShare
ReportReport
Posted on by 26

By default I have auto save turned off at the organization level.  However, I have one form where I want it turned of for.  I have seen the javascript that shows how to turn it off, but not on.  Does anyone know how to turn it on for a certain form?  I have a workflow kicking off and then a business rule also kicks off.  The business rule is what is causing the unsaved changes.  I don't want to have the user to open the record up and click save.  So I was wondering if there was something that I can put in via JavaScript that would just save the form automatically without having to open it.

Thank you in advance.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Alex Fun Wei Jie Profile Picture
    33,628 on at

    Hi,

    since business rule is the one who causing the unsaved changes. Why dont you set the business rule scope to entity mode.

    www.inogic.com/.../business-rule-updates-in-dynamics-crm-2015

  • Suggested answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    Hi,

    The unsaved changes occurs if the values is changed. If you know that business rule is changing the value then why don't you put aditional check to only update the field if the value is not there or not same.?

    Hope this helps.

  • Verified answer
    gdas Profile Picture
    50,091 Moderator on at

    Hi,

    I agreed with  Alex , try to set the scope of business rules Entity .

    Second you can not fire onchange event when field set using business rules so you can put the condition not to set the value if you dont need.

    You can not enable autosave for particular entity out of the box , so you can write the complete business rues  logic using JS and when you set the value fire Xrm.Page.data.entity.save() .

    If you still want to use the business rules then you can try with below code registering method in the onload of the forms , it will save data every certain interval but make sure  this is not a good practice.

    function AutoSaveForm() {
        if (Xrm.Page.ui.getFormType() == 2) { // will fire only for update record
            var intervalId = window.setInterval(
             function () {
                 window.clearInterval(intervalId);
                 Xrm.Page.data.entity.save()
             }, 3000); // Data will save every 2 seconds
        }
    }
  • USA80 Profile Picture
    26 on at

    Thank you guys...I was able to get this working, by taking the business rules out and putting them in a 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

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