Behavior of SSA field in Customized entity

By | June 26, 2015

Hi folks! Hope you all must be aware of “SSA” (i.e. Search Select Advance) field in crm. I will define it in one sentence “Acts as a bridge between two entities”. Now, I will explain it in more detail by taking two scenario’s (i.e. Standard entity, customized entity). What exactly I want to say is as follows.
New Stuff: Hide field without scripting
BlogImg1
From above image, what I want to explain is that in opportunity we have a SSA field named as Company which allows us to select a particular company against that opportunity. And, on click of that selected company hyperlink company Summary popup window opens up. But, when you link your SSA field of a Customized Entity you find below error.
BlogImg2
To avoid above error you need to call below mentioned function on “On-load Script” of the respective screen.
function PageOnLoad()
{
if(document.EntryForm.SSA_Field)
{
var SSA_FieldId = “”;
var sASurl= document.EntryForm.SSA_Field.value;
if(sASurl!=””)
{
SSA_FieldId = getLineItemValue(“Key58”,sASurl);
SID=new String(crm.getArg(“SID”,sASurl));
if(SID==”” || SID==”undefined” || SID==”null”)SID=”0″;
sInstallURL=crm.installUrl();
var sNewURL=”&Act=432&Mode=1&CLk=T&Key0=58&Key37=”+SSA_FieldId+”&<Linked Entity PrimaryId>=”+SSA_FieldId
sNewURL += “&dotnetdll=<linked Entity>.crm.dll&dotnetfunc=Run<linkedEntitySummary>Summary&Key58=”+SSA_FieldId+””;
var sFinalURL=sInstallURL+”eware.dll/Do?SID=”+SID+sNewURL
document.EntryForm.SSA_Field.value = sFinalURL;
}
}
}
function getLineItemValue(name,sURL)
{
var winURL = sURL;
var queryStringArray = winURL.split(“?”);
var queryStringParamArray = queryStringArray[1].split(“&”);
var nameValue = null;
for ( var i=0; i<queryStringParamArray.length; i++ )
{
queryStringNameValueArray = queryStringParamArray[i].split(“=”);
if ( name == queryStringNameValueArray[0] )
{
nameValue = queryStringNameValueArray[1];
}
}
return nameValue;
}
Explanation of Above Code:
The “PageOnLoad ()” function simply gets the “Primary ID” and required “URL”. And “getLineItemValue ()” function returns the “Primary ID” value of the customized entity.
Note:  sNewURL holds the URL that is required to show summary of customized entity. I have highlighted the same on above image.
Once these is done your task is done. Find below screen for your reference with resolved issue.
BlogImg3
 
Happy Scripting!!
1. Merge Company Source SSA
2. SSA field behavior for custom entity in Sage CRM
3. Control Display Format for Person SSA field in Sage CRM
4. Accelerate your Line Item Entry process using GUMU Integration
5. One Time Processes for GUMU™ Sage CRM – Sage 100 integration