Usually when you want to add a primary contact to an Account it is for a contact already associated with the account. If you know the contact full name (and spelling) you just type it in simple. But what if you just know the first name or last name? You have to search for the contact. To start with add the “Parent Customer” to the find columns of the Contacts Lookup View. Now you can search for the contact by the account name. But why should you have to type in the account name again. All you need to do is add some JavaScript to the onChange event for account name on the account form.
crmForm.all.primarycontactid.additionalparams = ’search=’ + crmForm.all.name.DataValue;
This is great it fires when ever the account name changes. How about when the account name doesn’t change? Here you just need to add a line of script to the onLoad event on the account form.
crmForm.all.name.FireOnChange();
This fires the onChange event for the account name when the form load. Now when you click on lookup contact it will be filter by account name. (Remember to add “Parent Customer” to the find columns of the Contacts Lookup View or this will not work.)
Look to be able to select the contact right from the contact grid(main and associated) in the next version of icrmOneClickActivities.