Wednesday, November 26, 2008

Submitting an IFramed Web App running within Microsoft CRM 4.0 - from CRM

Jan 09 UPDATE: I have written a better way to do this here.

This is a quick tip that might save you hours trying to figure this out (or maybe not) which is to force a page submit when the user clicks save within CRM.

In the JavaScript OnLoad event of the Form in CRM, place the following JavaScript:

document.frames("IFRAME_name").document[0].submit();

Where "IFRAME_name" is the actual name of your IFrame.

Then in your OnLoad event of your ASPX web page, you can write something like:
if (IsPostBack)
Save();
Note, for each postback you'll end of saving the form - something to bear in mind.

1 comment:

Anonymous said...

shouldn't this be in the onsave event of the page instead of the onload event.