Refresh web resource after record created (2013) RRS feed

  • Question

  • We've got a web resource that requires the entity ID in order to work (i.e: it wont work until the record has been saved) It gets the record ID from the querystring passed to it.

    In CRM 2013 the page isn't refreshed after the form is saved, nor is the webresource refreshed with real querystring data, so on new records my web resource never receives the record ID from CRM. I tried creating an on-save event (which fires before the record is saved) to refresh the form after a timeout, which despite being a massive hack CRM still doesn't like it (detects the form as dirty). In addition the OnLoad event is no longer called after the record is saved.

    How can I add support for CRM 2013 to my web resource? As I can't find a way to let it know that the entity ID is available.
    Tuesday, December 17, 2013 11:08 AM

All replies

  • Hi,

    Have you tried to call your web resource from a Javascript code?

     - In that code you should have a function that calls your web resource and receives de entity/form Id as parameter when it is triggered.

    - by passing the Id you should be able to send it to your web resource.

    Tuesday, December 17, 2013 2:48 PM
  • thanks for your answer tiagolvsantos, yes I can re-write the url the web resource iframe is looking at using `setSrc` and get the form ID from parameters passed to any JS form function (or by using `Xrm.Page.entity.getId()`), The problem is I can't see that there's any javascript form events that are guarenteed to fire after the record is created and before that point the record won't have an ID to pass to the JS functions as parameters.

    When you look at these parameters before the record is saved it looks like a minified JSON object that's impossible to comprehend.

    Tuesday, December 17, 2013 3:57 PM