Hi,
I want to send email to the Team. A queue is associated to that team.
In javascript, I can retrieve the Queue Id(guid). Now, my question is how should I set queue to the "to" field of the email.
Currently I am using below code but it throws error "Lookup control error" because I don't know how to set queue id. It works fine if I send email to single email address and not the team.
var partyRequired = Xrm.Page.getAttribute("to");
// Create new array
var partlist = new Array();
partlist[0] = new Object();
partlist[0].id = id; //Guid (i.e., Guid of User or Contact etc)
try
{
partlist[0].name = recipientEntity.attributes["emailaddress1"].value;
}
catch (exc)
{
try
{
partlist[0].name = recipientEntity.attributes["internalemailaddress"].value;
}
catch (exc)
{
partlist[0].name = "";
}
}
partlist[0].entityType = entityType; //entity schema name of account or contact
partyRequired.setValue(partlist);
*This post is locked for comments
Thanks Aric. Solved my problem.
The following should work:
var partyRequired = Xrm.Page.getAttribute("to");
var partlist = new Array();
partlist[0] = new Object();
partlist[0].id = Id; //Guid of Queue
partlist[0].name = "Name"; // Name of Queue
partlist[0].entityType = "queue";
partyRequired.setValue(partlist);
Hope this helps.
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,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156