Skip to main content

Notifications

Announcements

No record found.

Service | Customer Service, Contact Center, Fie...
Suggested answer

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

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

  • SBeal Profile Picture
    SBeal 50 on at
    RE: Set a Default Queue value for the From field in Email activity in Customer Service

    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

  • jazucco Profile Picture
    jazucco 25 on at
    RE: Set a Default Queue value for the From field in Email activity in Customer Service

    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.

  • Jolas365 Profile Picture
    Jolas365 235 on at
    RE: Set a Default Queue value for the From field in Email activity in Customer Service

    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.

  • Jolas365 Profile Picture
    Jolas365 235 on at
    RE: Set a Default Queue value for the From field in Email activity in Customer Service

    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
    Jolas365 235 on at
    RE: Set a Default Queue value for the From field in Email activity in Customer Service

    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

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: Set a Default Queue value for the From field in Email activity in Customer Service

    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/

  • Steve Pillar Profile Picture
    Steve Pillar 156 on at
    RE: Set a Default Queue value for the From field in Email activity in Customer Service

    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
    Nya Profile Picture
    Nya 29,056 on at
    RE: Set a Default Queue value for the From field in Email activity in Customer Service

    Hi Jolas365,

    Here is a tutorial which can achieve your request.

    Populate the Email “FROM” Field with the Email Address of the User’s Queue - CRM Software Blog | Dynamics 365

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!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans