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
This was now completed and posted the results in the Stack Overflow link in the first post.
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.
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