Archive for July, 2008

Entity Customizations

Monday, July 21st, 2008

Default behavior of CRM is to display Related Entities in the Navigation pane of the Primary Entity. A little bit of tweaking in form JS can give us multiple customization options.

In the example below, we remove Entity from the navigation pane and display its associated grid view in a new tab on our Entity form.

photo1.jpg
Similarly image below illustrates related entities in Iframes on the same tab. 

Related Entities

Here is the javascript to achieve this functionality:

function GetDisabilityFrame(){
    if (crmForm.ObjectId != null)         

    {         

        var oId = crmForm.ObjectId;         

        var oType = crmForm.ObjectTypeCode         

        var security = crmFormSubmit.crmFormSubmitSecurity.value;         

        navpo_po_disabilitytype_contact.style.display = "none";
        return "areas.aspx?oId=" + oId + "&oType=" + oType + "&security=" + security
        + "&roleOrd=2&tabSet=areapo_po_disabilitytype_contact";
    }         

    else         

    {         

        return "about:blank";         

    }
}         

crmForm.all.IFRAME_Disabilities.src = GetDisabilityFrame();
 

The above method simply returns the src for Disability Type grid and assigns it to our IFrame.

Use IE Dev toolbar to get the required src, as illustrated below:

IFrame Src

 
Share This Post

Share/Save/Bookmark

Welcome

PowerObjects Microsoft CRM blog is place where PowerObjects CRM team will share its Microsoft CRM knowledge with rest of the world.More

Find entries :