Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

How to remove a Table from a Lookup field

(1) ShareShare
ReportReport
Posted on by 34
Hello,
 
Can someone help me how I change what tables a look up field can look up?  I have a field which looks up Accounts, Contacts and Users but I want to remove Users from the list.
 
  • Verified answer
    Dengliang Li Profile Picture
    Microsoft Employee on at
    How to remove a Table from a Lookup field
    Hi,
     
    Has the issue been solved?
    Have there been any updates? Please feel free to ask me if you have any questions!
    If it has been resolved, can you mark the response as an answer?
     
  • Dengliang Li Profile Picture
    Microsoft Employee on at
    How to remove a Table from a Lookup field
    Hi,
     
    The code is below:
     
    function addFilter(executionContext) {
        var formContext = executionContext.getFormContext();
        formContext.getControl("from").setEntityTypes(["queue"]);
     
    }
     
    Register the code to the onload event of the Enhanced Form of the mail entity.
     
    Upload the JS file and name it
     
     
    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,
    Dengliang Li
     
  • RM-30040732-0 Profile Picture
    34 on at
    How to remove a Table from a Lookup field
    Thanks! This is exactly what I want!
     
    Can you talk me through in more detail how to enter that code?  I am unfamiliar with api and the link doesn't tell me how to add it to my app.
     
    Thanks!
  • Suggested answer
    Dengliang Li Profile Picture
    Microsoft Employee on at
    How to remove a Table from a Lookup field
    Hi,

    This can be implemented using the following API.

    In my testing, this API was used to filter the From field of the email entity to show only the queue entity type.

     
    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,
    Dengliang Li
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,289 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,068 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans