Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

How to check if Microsoft dynamics CRM is down(IIS website) using javascript and throw an error on the screen on save event of a record

Posted on by 13,756

Hi Guys,

We have a strange requirement regards to CRM error handling.

if I bring IIS down and try to save a contact in CRM - it goes into infinite loop and literally nothing happens.

I thought of adding a javascript on the save event which will check if CRM is down and throw an error.

Any help here is appreciated.

Rawish

*This post is locked for comments

  • Verified answer
    Rawish Kumar Profile Picture
    Rawish Kumar 13,756 on at
    RE: How to check if Microsoft dynamics CRM is down(IIS website) using javascript and throw an error on the screen on save event of a record

    Thanks, Alex!

    This is a nice suggestion and even I have this in my mind and also you have provided the idea on how I can prevent this to be called on every save.

    Also I think what Aric Levin has suggested can be implemented too. More of an infrastructure thing not CRM.

  • Verified answer
    ashlega Profile Picture
    ashlega 34,475 on at
    RE: How to check if Microsoft dynamics CRM is down(IIS website) using javascript and throw an error on the screen on save event of a record

    Hi Rawish,

     I'm not sure of the requirement and of the reasons to have such a requirement.. But you might probably add a synchronous XmlHttpRequest request to the onSave to load some web resource from CRM, and, if that fails, you might cancel the save and display an error:

    Here is an example for XmlHttpRequest ( just make it sync):

    stackoverflow.com/.../xmlhttprequest-connection-check

     And, then, you can use context.preventDefault in the onsave..

  • Verified answer
    Aric Levin Profile Picture
    Aric Levin 30,188 on at
    RE: How to check if Microsoft dynamics CRM is down(IIS website) using javascript and throw an error on the screen on save event of a record

    The only thing is that you can have on the IIS side, set the server rules to restart if down, or you can have a process notify your own IT Support that server is down. If not that, you can't do much from the CRM side.

  • Rawish Kumar Profile Picture
    Rawish Kumar 13,756 on at
    RE: How to check if Microsoft dynamics CRM is down(IIS website) using javascript and throw an error on the screen on save event of a record

    But i dont think its possible.

  • Rawish Kumar Profile Picture
    Rawish Kumar 13,756 on at
    RE: How to check if Microsoft dynamics CRM is down(IIS website) using javascript and throw an error on the screen on save event of a record

    Hi Ambar,

    thanks for the response. However, I cant let user waiting for the save to stop or give an error.No error is coming up if bring IIS down before hitting the save. (until unless I don't hit f5)

    what I was looking for is if we can make a connection request to CRM again and get status and if no response; we put an alert.

  • RE: How to check if Microsoft dynamics CRM is down(IIS website) using javascript and throw an error on the screen on save event of a record

    Hello Rawish ,

    If iis will be in downstage then your web site should also be down and on that case any sever or client side scripting will not work.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans