February 19, 2008
Conditional Lookup on Primary Contact of an Account
This Post is based on a Post from AdvantageWorks in which a Filtered Lookup between 2 Lookups is described. Hessel Miedema and I created a Version of the Lookup for the Primary Contact of an Account. We used the Account Name as input for the Search Box of the Lookup of the Primary Contact. (Be aware that your Account Names need to be Unique in this Case).
The main Reason for this Post is that we noticed that the “&” character is Not allowed in a URL Request, but is allowed as Search Value. The “&” character needs to be replaced by “%26″ to function properly. A list of characters can be found in the The extended ASCII table .
The example we used on the OnLoad of the Account:
crmForm.all.primarycontactid.additionalparams = 'search=' + crmForm.all.name.DataValue.replace("&","%26").replace("+","%2b");
—

(4 votes, average: 5.25 out of 7)
