Skip to main content

Notifications

Customer Service forum
Suggested answer

Customize Contact Lookup Field

Posted on by 35
Hi, in the case form, I added a contact field so that the user can select a contact when creating a case because I want them to add the account in the customer field and the contacted individual in the contact field. 

Is there a way to customize the contact lookup field so that it only shows the contacts associated with the selected customer instead of showing all active contacts? (by customer I mean account)

Categories:
  • YB Profile Picture
    YB 35 on at
    Customize Contact Lookup Field
    Hi, yes it is the same one.

  • Suggested answer
    Cui Hao Profile Picture
    Cui Hao on at
    Customize Contact Lookup Field
    Hi,
     
    There are two /Contact/ fields in the system, you need to add the field logically named /primarycontactid/.
    Do you see that the fields you've added are the same as the ones I've shown below?
    If it's convenient, could you please take a screenshot to show me the field properties?
     
    Best regards,
    Cui Hao
     
     
     
  • YB Profile Picture
    YB 35 on at
    Customize Contact Lookup Field
    Hi, it is not working in my case. Even when I don't click on all records, it shows me all the contacts in the system instead of just showing me the ones associated with the selected customer. 
  • Suggested answer
    Cui Hao Profile Picture
    Cui Hao on at
    Customize Contact Lookup Field
    Hi,
     
    Do you have any other questions? If you have any other questions feel free to ask me.
    If it solved your problem, please mark it as verified to help other community members find more. 
     
     
     
    Best regards,
    Cui Hao
  • Suggested answer
    Cui Hao Profile Picture
    Cui Hao on at
    Customize Contact Lookup Field
    Hi,

    I found an existing /Contact/ field in the system that accomplishes your needs.
    To verify that this system field is available, I did the following test:
    As you can see through this web request, the filtering conditions of this /contact/ system field are based on this /Customer/, and as long as you don't click to switch to /All Record/, then it will prioritize the contacts associated with the selected customer by default.




    I also tried redefining a lookup field using JavaScript, but found that I still get the same problem as with this system field.
    After various tests, I found that the reason I could switch to /All Records/ was because of the Lookup control's original functionality, and even re-customizing the field filtering logic wouldn't change the control's already existing functionality.

    So I recommend you to use this /Contact/ system field, which will prioritize the display of this contact related to Customer, as long as you don't make the switch.



    If my answer was helpful, please click Like, and if it solved your problem, please mark it as verified to help other community members find more. If you have further questions, please feel free to contact me.


    Best regards,
    Cui Hao

Helpful resources

Quick Links

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

June 2024 Dynamics 365 Community Newsletter

Catch up on the latest news, events, and plans in the community

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 285,407 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,446 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans