web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Suggested Answer

Set a Default Queue value for the From field in Email activity in Customer Service

(0) ShareShare
ReportReport
Posted on by 235

Hello CS experts,

I came across this requirement to set up a default queue value for the "From" field in an email instead of the currently logged user.

I'm not sure if there's an OOB way to achieve this.

Thanks in advance for the help that you could provide.

pastedimage1650346163356v1.png

pastedimage1650346229841v2.png

Regards,

Jolas365

  • Suggested answer
    Nya Profile Picture
    29,064 on at
  • Steve Pillar Profile Picture
    156 on at

    Hi,

    I've followed the steps detailed in the tutorial but it doesn't work, as someone has commented on the tutorial itself.

    Any further comments?

    Thanks

    Steve

  • Suggested answer
    Bipin D365 Profile Picture
    28,995 Moderator on at

    HI,

    Use below code on Onload of Email form.

    function _setFromUser(executionContext) {

       var formContext=executionContext.getFormContext();

           var formType = formContext.ui.getFormType();

           //var legalQueueID = "87644a7e-7869-ec11-8943-6045bda57288";

           //var recordName = "87644a7e-7869-ec11-8943-6045bda57288";

    alert("Form Type:"+ formType);

           var entityName = "queue";

           if(formType ==2 || formType == 1 || formType == 0) { //Return Value Client API Reference: docs.microsoft.com/.../getformtype

    Xrm.WebApi.online.retrieveMultipleRecords("queue", "?$select=queueid,name&$filter=name eq 'Mailbox Queue'").then(

    function success(results) {

    console.log(results);

    for (var i = 0; i < results.entities.length; i++) {

    var result = results.entities[i];

    // Columns

    var queueid = result["queueid"]; // Guid

    var name = result["name"]; // Text

    formContext.getAttribute("from").setValue([{ id: queueid, name: name, entityType: entityName }]);

    }

    },

    function(error) {

    console.log(error.message);

    }

    );

       }

    }

    Replace 'Mailbox Queue' with your Queue Name.

    Please mark my answer verified if this is helpful!

    Regards,

    Bipin Kumar

    Follow my Blog: xrmdynamicscrm.wordpress.com/

  • Jolas365 Profile Picture
    235 on at

    Hello Bipin Kumar ,

    The requirement is to replace the User's Queue with another mailbox Queue.

    Lets say users A and B want to send emails.

    When they send an email, their User's Queue should not appear in the "From" field. What should appear instead are two different Queue mailbox, replacing their names.

    Regards,

    Jolas365

  • Jolas365 Profile Picture
    235 on at

    Hello Nya ,

    The requirement is to replace current logged-in user's name in the "From" field with a Mailbox Queue.

    Here is the scenario:

    1.Two users are logged-in  --> user A and User B

    2. Two Mailbox Queue        --> mailbox C and mailbox D

    3. user A sends email          --> "From" field of email will show mailbox C instead of user A name

    4. user B sends email          --> "From" field of email will show mailbox D instaed of user B name

    I hope this clarifies the requirement.

  • Jolas365 Profile Picture
    235 on at

    Hello Bipin Kumar ,

    The requirement is to replace current logged-in user's name in the "From" field with a Mailbox Queue.

    Here is the scenario:

    1.Two users are logged-in  --> user A and User B

    2. Two Mailbox Queue        --> mailbox C and mailbox D

    3. user A sends email          --> "From" field of email will show mailbox C instead of user A name

    4. user B sends email          --> "From" field of email will show mailbox D instead of user B name

    I hope this clarifies the requirement.

  • jazucco Profile Picture
    25 on at

    This worked great. Is it possible to take this one step further and have the queue be dynamic? I am trying to sort out how to pull the owning Queue from the ExecutionContext but haven't been able to get that to work.

    Within Dynamics 365 Case Management I would like to do the following:

    - User selects a case to work on from their queue

    - If they create a new email, or respond to an existing email, in the timeline I want to have the From field be populated with the Case (Queue Item) that the email is associated with.

    If tried using Xrm.WebApi.retrieveRecord to try and find the case that the email will be associated with in the hope of then finding the queue that owns the case. But so far no luck.

    Any ideas would be greatly appreciated.

  • SBeal Profile Picture
    50 on at

    Can you do retrieveRecord on the queueitem table where the Object field = case?

    The queueitem table has a field for which queue owns this item

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
Travis South Profile Picture

Travis South 45

#2
11manish Profile Picture

11manish 39 Super User 2026 Season 2

#3
Ayesha Wajahat Profile Picture

Ayesha Wajahat 18

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans