javascriptdynamics-crmcrmdynamics-crm-online

How to get input relative to Xrm.Page.getContext("*any name*") or getAttribute


I am using CRM Online and I want to get DOM element from XRM.Page object using JavaScript. So, how can I get access to input that is relative to control or attribute element got from Xrm.Page.getContext("any name") or Xrm.Page.getAttribute("any name").


Solution

  • Getting access to the HTML DOM of a form is not supported and cannot be done through the Xrm.Page API (which is deprecated b.t.w.). It is not recommend too as Microsoft can decide to modify page rendering without giving notice.

    However, you can customize the UI of a form to a high degree by designing your own PCF control. You can find a Tutorial here, along with a few sample components.

    Guido Preite created a PCF Gallery with tons of great examples.