Microsoft Dynamics 365

Dynamics 365 : Create a Lookup Field for Contact

Atul Sharma

What is a Lookup field?

When you need a control on form, where you can

  1. Directly enter the recent/ most used items.
  2. Search for more records.
  3. Create a new record.
LookUpSample

The only savior is “Lookup field“.

How to add a Lookup field?

Now we will see, how to add such field in our form. More specifically, I will be adding here Contact entity as the lookup field.

As depicted in below picture, it has the following stages –

  • Go to Entity, to which you want to add the field. (e.g. Client)
  • Select the Fields item, as shown here and click on “New” field from the page.
LookUpSample2
  • Add the Display Name for new fields and set requirement as per you business requirement.
  • Select the Data type = Lookup from the drop down.
  • Select Target Record Type = Entity you want to see in lookup field (e.g. Contact)
  • Relationship name field will have a default value, you can change it, though.
LookUpSample1
  • Save and close this page.
  • Go to form and add this field as you wish to.
  • Save it and Publish it, now you can see Contact as lookup field in your form.
See also  All About C# Immutable Classes

How does Lookup field work?

Lookup refers the primary field of the connected entity.

Getting familiar with lookup field

  • You can just select the most recent or items already appearing in control.
  • You can search for more records, on click of “Lookup more records” and it will open this screen, where
    1. You can’t change the Entity name in drop down list for Look for.
    2. Here you can search your record from all the views accessible to you.
    3. Your keyword for search will go here.
    4. You can select if you want to show all records or only created by you.
    5. You can refresh the search grid.
    6. It will open up new Main form for new entry.
    7. You can choose this record to be shown in control i.e. this is your required search result.
    8. It will open up the main form of selected record and then you can delete or perform some other activities over there.
LookUpSample3
  • You can create a new entity record, just by clicking “+ New“. It will open Quick Create form to add the new record.

Conclusion

I hope this basic information about lookup fields, helps the beginner.