Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Filtering the "from" lookup to show certain datatypes

Posted on by

I have also posted this question at: http://stackoverflow.com/questions/38176653/dynamics-crm-2016-edit-lookup-email-from-field

I am using Microsoft Dynamics 2016, and need to clean up the options in the from field of the default email form.

So the aim is to limit the results in the lookup for the email "from" field. By default it shows all companies, contacts etc. However, we will only be using queues and users in the "from" field.

How can I limit the lookup and search items to only use queues and users? It appears that this is derived from a party list, however, I can not find any information on editing a party list inputs.

I thought maybe https://msdn.microsoft.com/en-us/library/gg334266.aspx#BKMK_addCustomFilterwould be an option, but can't work out how to feed the attribute types of queue (2020) and user (8) in to form the lookup.

Using some code from https://social.microsoft.com/Forums/en-US/3b97a306-4df7-4128-a3a9-e516c46c565d/limit-customer-lookup-in-opportunity-to-accounts-only?forum=crmdevelopment I came up with the following code:

function setFromLookupOptions()
{
    document.getElementById("from").setAttribute("lookuptypes", "8,2020");
}

However, this code just brings up errors, saying it cant setAttributes of Null (indicating it can not find the "from" field, but that's what it's labelled in the form). I have also tried using "from_i" as per the note at the top of the first block of code at https://bernado-nguyen-hoan.com/2015/10/28/correcting-available-lookup-views-when-restricting-lookup-types-via-javascript-in-crm/ however, it can't seem to find an element with that name.

So how can I do this?

*This post is locked for comments

  • MicWit Profile Picture
    MicWit on at
    RE: Filtering the "from" lookup to show certain datatypes

    This was now completed and posted the results in the Stack Overflow link in the first post.

  • MicWit Profile Picture
    MicWit on at
    RE: Filtering the "from" lookup to show certain datatypes

    Awesome, thanks for that. I'm done for today, but have it kind of working, will finish the job off tomorrow. This was what I was looking for.

  • Verified answer
    BharatPremji Profile Picture
    BharatPremji 2,485 on at
    RE: Filtering the "from" lookup to show certain datatypes

    Hi,

    Have a look at this thread:

    community.dynamics.com/.../186549

    Bharat

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans