Passing data between web resources CRM 2013
Assume you have 2 HTML web resources on your CRM form and you want to pass data from 1 resource to another, below are the steps. In my example I have 2 HTML pages with a Textbox and Button.
On Button click, I am reading the value from current HTML page Textbox and setting in to other HTML resource. Below is the script on button click event.
// Get the other web resource using ‘Parent.Xrm’ var otherResource = parent.Xrm.Page.ui.controls.get(‘{Webresource_SchemaName}‘).getObject().contentWindow; // Get the Text box control from other resource var txtBoxOtherResource = otherResource.document.getElementById(“txtPage2”).value; // Set the value to the Text box control txtBoxOtherResource.value = document.getElementById(‘txtPage1’).value;
Note : To get schema name of a webresource,
- Open the Customizations form
- Double click on the web resource and get it as mentioned below
🙂