locked
Disable an HTML control in HTML web resource inserted on a Microsoft Dynamics CRM 2013 entity form after saving the form RRS feed

  • Question

  • Hi,

    I have added an HTML web resource (containing an option set field) on one of the custom entities form. I want to disable the field (that is option set or drop-down list on the HTML web resource) when a new form is saved. That means the field will only remain enabled for a new form and will get disabled as soon as the form is saved and will remain disabled further. I have written JavaScript code on load of the entity form to keep the field enabled for "New" form and disable it for "Update" form.

    The field is not getting disabled when a new record for the entity is saved. Because, in CRM 2013, the form does not get refreshed after saving it and hence the OnLoad event does not get triggered.

    Any idea how to solve this issue?

    Thursday, January 22, 2015 10:08 AM

All replies

  • Put your code on save event when the formtype is create and onload when the formtype is update

    Regards Faisal

    Thursday, January 22, 2015 10:21 AM
  • Is there any way to disable an HTML control in the HTML web resource inserted on crm entity form through java script written on save of the entity form?
    Thursday, January 22, 2015 1:38 PM
  • write the logic to disable controls in html onload. but when the form is refreshed the html control will not get refreshed which can be handled by method mentioned in below URL

    https://community.dynamics.com/crm/b/crminogic/archive/2014/09/01/update-html-on-form-save-button.aspx


    If my response answered your question, please "mark the response as an answer" and also "vote as helpful". Regards, Hari. www.crm2011byhari.blogspot.com

    Thursday, January 22, 2015 2:46 PM
  • Put the web resource in a seperate section and try disabling the section

    Regards Faisal

    Thursday, January 22, 2015 4:40 PM
  • Thanks Hari.

    I have found following useful link-
    http://nishantrana.me/2014/04/09/refreshing-the-web-resource-in-crm-2013/

    Also, "Xrm.Page.ui.controls.get('WebResource_Name')" and " Xrm.Page.getControl('WebResource_Name')" methods are not supported by Microsoft Dynamics CRM Online. Hence, both the solution works for Microsoft Dynamics RM 2013 on-premises only.

    Is there any way to support the functionality for Microsoft Dynamics CRM Online as well?

    Wednesday, January 28, 2015 10:34 AM
  • Thanks Faisal. I have added JavaScript code on save event to disable an HTML control in HTML web resource inserted on Microsoft Dynamics CRM entity form. 

    I have found following useful link-
    http://nishantrana.me/2014/04/09/refreshing-the-web-resource-in-crm-2013/

    Also, "Xrm.Page.ui.controls.get('WebResource_Name')" and " Xrm.Page.getControl('WebResource_Name')" methods are not supported by Microsoft Dynamics CRM Online. Hence, both the solution works for Microsoft Dynamics RM 2013 on-premises only.

    Is there any way to support the functionality for Microsoft Dynamics CRM Online as well?


    Wednesday, January 28, 2015 1:04 PM