Friday, September 12, 2008

Passing CRM Form values to an IFrame

I assume that you have already added an IFrame to the entity amd unchecked "Restrict cross-frame security" under IFrame properties > Security section

PASSING SINGLE PARAMETER TO AN IFRAME :

  • new_customfield1 - Schema name of my custom field.
  • IFRAME_Custom - Name of the IFrame.

Snippet (You may place it on OnLoad or OnChange of the CRM Form as per your requirements)

var CustomFieldValue = crmForm.all.new_customfield1.DataValue;
crmForm.all.IFRAME_Custom.src = 'http://localhost/YourURL.aspx?value='+CustomerFieldValue.

PASSING MULTIPLE PARAMETERS TO AN IFRAME :

  • new_customfield1 - Shema name of first custom field.
  • new_customfield2 - Schema name of the second custom field.
  • IFRAME_Custom - Name of the IFrame.

Snippet

var CustomField1 = crmForm.all.new_customfield1.DataValue;
var CustomField2 = crmForm.all.new_customfield2.DataValue;
crmForm.all.IFRAME_Custom.src='http://localhost/YourURL.aspx?value1='+CustomField1+'&value2=' + CustomField2;