Tuesday 29 July 2008

Passing parameters to iFrames in MSCRM 4.0


To pass the parameters to iFrames, first you must select the option to "Pass record object-type code and unique identifier as parameters" as shown in figure.

Each Microsoft Dynamics CRM entity has a corresponding object type. For example: Account=1, Contact=2.

Each record also has a globally unique identifier (GUID). When you create an IFrame, you can indicate if it needs to pass these parameters to the target URL. This will cause these parameters to be added to the URL.

EXAMPLE: Without parameters, the URL will likely be: http://youwebsite/yourwebpage.aspx.

With Parameters, the URL will be: http://youwebsite/yourwebpage.aspx?type="entitytype"&id="entityguid"


"entitytype" will be the Object Type of the entity and entityguid will be the GUID of that entity.


So in your target application, you can use querystring parameters to get these values.

For example to get the GUID of the entity you can use Request.Querystring("id")
and
to get Object Type, you can use Request.Querystring("type").



No comments: