Hyperlinking to a parent Custom Entity from a Search Select Advanced Field

1 minute read time.

This is a topic that has been recently covered within the forums. Since then I have been asked a few questions about this topic so I thought it was worth a separate article.

Below is the summary screen for an opportunity. This has come from a demonstration system in which little customization has been carried out.

In the screen above the foreign key (oppo_waveitemid) is of type Search Select Advanced and it provides a hyperlink to the parent wave item.

But the equivalent field for custom entities do not behave the same way.

Below is the same opportunity screen for a system that has had a project entity added. The custom project entity was added using the Advanced Customization wizard.

The new field doesn't provide a convenient hyperlink to the parent record.

Note: If a user clicks the change button and then presses CTRL+ double click upon the project field they will hyperlink to the linked project.

A hyperlink to the parent record can be added by using the create script to change the caption of the field. e.g oppo_projectid


var intRecordId = CRM.GetContextInfo("opportunity","oppo_projectid");
var strURL = CRM.URL("project/projectsummary.asp")+" &proj_projectid="+intRecordId;
var strCaptionText = "Project";
var strFullCaption = ""+strCaptionText+":";
Caption = strFullCaption;

This will add the hyperlink below

Note: This has added the lookup behaviour to the caption not the data field as that would require a different technique using client side code. That type of customization is discussed in other articles.