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 check if Microsoft dynamics CRM is down(IIS website) using javascript and throw an error on the screen on save event of a record

(1) ShareShare
ReportReport
Posted on by 13,758

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

I have the same question (0)
  • gupta.ambar2009@gmail.com Profile Picture
    797 on at

    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.

  • Rawish Kumar Profile Picture
    13,758 on at

    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.

  • Rawish Kumar Profile Picture
    13,758 on at

    But i dont think its possible.

  • Verified answer
    Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    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.

  • Verified answer
    ashlega Profile Picture
    34,477 on at

    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
    Rawish Kumar Profile Picture
    13,758 on at

    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.

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