Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

JavaScript Error "Server is Busy"

(0) ShareShare
ReportReport
Posted on by

Hi,

I am using the below java script code but getting the alert "Server is Busy". I am calling the method on the onSave event of the form.Any suggestion.

function OnSaveMethod(){

Xrm.Page.data.save().then(
function(){
Xrm.Utility.alertDialog("Record saved");
},
function(error){
Xrm.Utility.alertDialog(error.message);
});

}

Thnaks,

Amit Kumar Rath

*This post is locked for comments

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: JavaScript Error "Server is Busy"

    As a system user I'd be very annoyed with a pop-up each time it was saved... Have you considered running a form notification on OnSave?

       Xrm.Page.ui.clearFormNotification("saved");

       Xrm.Page.ui.setFormNotification("Record has been saved.", "INFORMATION", "saved");

    You can add a javascript timeout to automatically clear it too.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: JavaScript Error "Server is Busy"

    ranjeetpatel.wordpress.com/.../crm-on-save-server-is-busy-error

    Try to use this link..

    I was able to resolve this issue. it is working for me..

  • Andreas Cieslik Profile Picture
    Andreas Cieslik 9,267 on at
    RE: JavaScript Error "Server is Busy"

    Could you resolve this issue now? Can you give us a status please?

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: JavaScript Error "Server is Busy"

    https://ranjeetpatel.wordpress.com/2018/02/05/crm-on-save-server-is-busy-error/

    Try to use this link.. 

  • Suggested answer
    Andreas Cieslik Profile Picture
    Andreas Cieslik 9,267 on at
    RE: JavaScript Error "Server is Busy"

    function onSave(context) {

    var saveEvent = context.getEventArgs();

    Xrm.Page.data.save().then(
    function(){
    Xrm.Utility.alertDialog("Record saved");
    },
    function(error){
    Xrm.Utility.alertDialog(error.message);
    });

    saveEvent.preventDefault();
    }

    or

    function onSave(context) {

    var saveEvent = context.getEventArgs();

    setTimeout(function(){Xrm.Page.data.save().then(
    function(){
    Xrm.Utility.alertDialog("Record saved");
    },
    function(error){
    Xrm.Utility.alertDialog(error.message);
    });},1000);

    saveEvent.preventDefault();
    }

  • RE: JavaScript Error "Server is Busy"

    Thanks for the input, but in my case the record is getting saved but the error message is coming i.e. "Server is Busy".  Could you send me the optimized code and the exact steps which i need to follow?

  • Suggested answer
    Andreas Cieslik Profile Picture
    Andreas Cieslik 9,267 on at
    RE: JavaScript Error "Server is Busy"

    Please follow this blog article:

    neilparkhurst.com/.../javascript-prevent-save

    You need to pass the context as described in the article.

    Then you need to call:  saveEvent.preventDefault();

    this will prevent to end up in an infinite loop.

  • RE: JavaScript Error "Server is Busy"

    My requirement is....... whenever the user will make any changes on the record and save the record a popup should come saying that "Record Saved Successfully" after the record is saved.

  • Suggested answer
    Andreas Cieslik Profile Picture
    Andreas Cieslik 9,267 on at
    RE: JavaScript Error "Server is Busy"

    Why do you want to call Xrm.Page.data.save() in the OnSaveMethod of your form?

    This will give an invite loop and therefore you get "Server is Busy" message.

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,711 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,458 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans