Hi,
In the Customer Field of the Case Card Form, I'd like our users to only be able to choose Accounts (not Contacts) with Relationship Type = "Customer" (so not Leads, Prospects, etc.)
Is there a way to do this?
Kind regards,
Nina
*This post is locked for comments
Hi,
Instead having 2 filters , add to it respective custom filter.
Change condition and field name as per your need.
var contactFilter = "<filter type='and'><condition attribute='customertypecode' operator='eq' value='1' /></filter>";
var accountFilter = "<filter type='and'><condition attribute='accountid' operator='not-null' /></filter>";
Xrm.Page.getControl("customerlookupfield").addCustomFilter(contactFilter, "contact");
Xrm.Page.getControl("customerlookupfield").addCustomFilter(accountFilter, "account");
Thanks
Ajyendra
if this answer is helpful to you. Please Mark as Verified.
Hi Ajyendra,
Thanks a lot, that answers the first half of my question.
However, I still do not know how to filter on a field (in my case the custom field Relationship Type) of a field (Customer). Would you have an example of the code for this as well?
Kind regards,
Nina
Hi ,
Please Refer that Link:
Hope it helps
Thanks
Ajyendra
If this answer is helpful to you . Please Mark as Verified.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156