top of page
Search

Multiple relationships between the same entities cause multiple lookups to be populated with the same value

  • Aug 30, 2010
  • 1 min read

Imagine that you create multiple relationships between Accounts and Contacts. This will create several lookup attributes on the Contact entity which may be added to the Contact form.


When a new contact is created within an Account all the lookup attributes will be populated with the name of the Account. Often this is not desirable but according to a Microsoft article (no longer available) this is by design.


The article suggests using workflow as a workaround. I've found that is it is simpler to use JavaScript to set the values of lookup fields to null (apart from the main one that links a record to its parent). To do this use code similar to the following in the On Load event of a form - make sure you include the test to see if this is a new form otherwise you will overwrite legitimate values in an existing record.

if (crmForm.FormType == 1)
{
crmForm.all.new_lookup1id.DataValue = null;
crmForm.all.new_lookup2id.DataValue = null;
// and so on
}

 
 
 

Recent Posts

See All
New AB Exams from Microsoft

Four new exams with related courses and the prefix AB were released by Microsoft during December 2025 and January 2026. These are summarized in the table below. Exam Study Guide Title Link to Course A

 
 
 

Comments


bottom of page