Linking Associated Views from non-linked Entities
In CRM 2011, relationship(1:N) must be exists to show associated records from linked entity.
Such records can be shown as Sub-Grid or on Form Sub-Grid. However at times we might have to show up data from related entities where there is no CRM relationship exists between the entities. This scenario is more prominent where there is integration between multiple CRM instances.
I found one way to do this. Following URL can be used to set a Read-Only CRM Entity form
http://SERVER Name/ORG NAME/userdefined/areas.aspx?
Query String Parameters
| Parameter | Value | Comments |
| oId | UniqueIdentifier | GUID of the Foreign Key |
| oType | Numeric | Entity Type code for entity for which data needs to be shown |
| security | This can be any non-negative number | I could not find out exact purpose of this parameter but taking this parameter out cause error. So we have to give some numeric value for this parameter |
| tabSet | SchemaName of relationship | This information can be copied from Relationships section of Entity Customization. |
Example:
Calling URL in IFrame: In above given URL query parameter oId is only parameter which needs to be dynamically set depending upon parent entity Id. For this I created a HTML Web Resource and added a IFrame in it. Following JavaScript function reads GUID value and sets it in URL
| <script type=”text/javascript” language=”javascript”>
function OnFormLoad() { var gsxGuid = window.parent.Xrm.Page.getAttribute(‘gsx_gsxguid’).getValue(); gsxFrame.src = http://ServerName/OrgName/userdefined/areas.aspx?oId=%7b + gsxGuid + “%7d&oType=10030&security=0&tabSet=new_partner_new_cert_MPartner”; </script> |
Screenshot.
Here is how it looks
Hope this helps you.