CustomEntity Lookup & Link Back Issue RRS feed

  • Question

  • In Dynamics CRM 2011, I want to create an entity and related data form where each entry in each field of the entity on the form is a lookup to another entity containing data that functions like a feeder into the current entity and form.

    To accomplish this, I created a new custom entity called c_addr_Address_Entity via the “Customize this system area”.

    This new custom entity is named c_addr_Address_Entity and contains the following fields.

    After creating the entity, I created a new custom form called c_addr_Address_form

    On this new custom form, named c_addr_Address_form, each of the five fields listed above will contain a “Lookup’ to a different feeder table as described below.

    I have five feeder entities

    1. c_sasb_Street_Number_Entity
    2. c_stname_Street_Name_Entity
    3. c_cty_City_Entity
    4. c_st_State_Entity
    5. c_zpc_Zip_Code_Entity

    Keeping that in mind, lets us look at the objective for using and applying the lookup tabales below.

    The c_addr_Street_Number_Field field on the c_addr_Address_Entity  entity will be a lookup off of a separate custom entity named c_sasb_Street_Number_Entity shown below

    The c_sasb_Street_Number_Entity entity contains a field named c_sasb_Number_Field as well as a field named c_sasb_Number_Description_Field with sample values for each as shown below.

    The c_addr_Street_Name_Field field on the c_addr_Address_Entity  entity will be a lookup off of a separate custom entity named c_stname_Street_Name_Entity shown below.

    The c_stname_Street_Name_Entity entity contains a field named c_stname_Street_Name_Description_Field as well as a field named c_stname_Street_Name_Name_Field with sample values for each as shown below.

    The same thing works for the City and State and ultimately the result is the form shown below in Figure 1-1.

    Figure 1-1

    I entered a bunch of addresses using this form and you can see them directly below in Figure 1-2

    Figure 1-2

    My problem is that I now want to take this Entity called Address and use it as a lookup from another Entity called Institution.

    So I created an Institution Entity which contains a field on my Institution form called ins_mailAddr

    This ins_mailAddr field is labeled as Mailing Address on the form shown in Figure 2-1 below, and is a lookup to the Address entity shown above in Figure 1-2

    Figure 2-1

    So I click the “lookup button” next to the Mailing Address Label and get the screen shown below in Figure 2-2 form which I select one of the addresses.

    Figure 2-2

    But when I click OK, the mailing address is not populated with the complete address I selected but instead has a gear icon in it as shown below in Figure 2-3

    Figure 2-3

    If I save the data I just entered and selected from looking, and then open up the data view for it as shown below in Figure 2-4, I don’t see valid mailing address data in the mailing address field.

    Figure 2-4

    If I click edit on this new entry I see the same gear icon next to the  mailing address label as I did when I made the original selection which is a problem.

    I know I am doing something wrong here and I am looking for some guidance on how I can achieve what I am looking to do with this lookup.

    I want the user to select the lookup next to the mailing address label and select one of the addresses, but I need to get that address on the Institution form, and stored in the Mailing Address Field of the Institution entity.

    How can I achieve this objective?

    The requirement is that I must use the lookup option and use it to select data that resides in the address entity.

    Any guidance or step by step processes you can direct me to would be greatly appreciated.

    Monday, January 27, 2014 6:57 PM


  • The Primary Field on the Address entity is what is shown in the lookup and related views.

    For custom entities, by default this is '<prefix>_name'.

    It looks like this field is currently unused, which is why it looks like nothing is pulled through in your lookup.

    You will need to create a plugin or workflow, or add some JavaScript to join all the individual address fields into the Name field.

    You would do this by triggering your logic (be it a workflow, plugin, or JavaScript) on change of any of the address fields that make up the full address, so that when any of them change, the full address name is updated.

    Hope that helps


    If my response helped you find your answer please show your thanks by taking the time to "Mark As Answer" and "Vote As Helpful".

    Twitter LinkedIn Facebook Blog Magnetism

    • Marked as answer by ACECORP Saturday, October 17, 2015 9:05 PM
    Monday, January 27, 2014 7:20 PM