Viewing linked entities in information tab
A lot of clients want to view the most important data inside of the first page that pop-ups in a new page.
For example they want to see all the contacts that are involved in a project. Normally they would have to open the project entity and click on the project members on the left side. Well with an Iframe and some javascript you can do this in a different way.
The code which is put in the OnLoad event of a form:
-----
var sArea = "[entity1]_[entity2]s";
var sBaseUrl = "http://servername/userdefined/areas.aspx?";
html = sBaseUrl;
html += "oId=" + crmFormSubmit.crmFormSubmitId.value;
html += "&oType=" + crmFormSubmit.crmFormSubmitObjectType.value;
html += "&security=" + crmFormSubmit.crmFormSubmitSecurity.value;
html += "&tabSet=" + sArea;
document.all.IFrame_Test.src = html;
-----
the sBaseUrl depends if the relationship is customentity to customentity (http://servername/userdefined/areas.aspx?) or entity to customentity (http://servername/areas.aspx?).
The sArea name is a combination of the two linked entites. Entity1 is the entity of the form and the second one is the linked entity (don't forget the 's' at the end). If we for example have two entities of which the schema name is new_test1 and a second entity new_test2 the sArea would be: "new_test1_new_test2s".
The result of this is:
For example they want to see all the contacts that are involved in a project. Normally they would have to open the project entity and click on the project members on the left side. Well with an Iframe and some javascript you can do this in a different way.
The code which is put in the OnLoad event of a form:
-----
var sArea = "[entity1]_[entity2]s";
var sBaseUrl = "http://servername/userdefined/areas.aspx?";
html = sBaseUrl;
html += "oId=" + crmFormSubmit.crmFormSubmitId.value;
html += "&oType=" + crmFormSubmit.crmFormSubmitObjectType.value;
html += "&security=" + crmFormSubmit.crmFormSubmitSecurity.value;
html += "&tabSet=" + sArea;
document.all.IFrame_Test.src = html;
-----
the sBaseUrl depends if the relationship is customentity to customentity (http://servername/userdefined/areas.aspx?) or entity to customentity (http://servername/areas.aspx?).
The sArea name is a combination of the two linked entites. Entity1 is the entity of the form and the second one is the linked entity (don't forget the 's' at the end). If we for example have two entities of which the schema name is new_test1 and a second entity new_test2 the sArea would be: "new_test1_new_test2s".
The result of this is:
