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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Answered

Case email send as queue instead of individual - dynamically based on queue?

(0) ShareShare
ReportReport
Posted on by 65

Hi, the default behaviour when sending an email is for it to show as from the individual. I would like it to instead show as from the queue which the case is in. Is anyone aware of a way to do this dynamically based on queue?

I am aware there are some workarounds to create workflows or use JavaScript, but they do not dynamically set the queue. For context we have multiple queues so rather than sending "from" the fixed address of a particular queue I'd want the email to send as from the relevant queue the case is actually in?

I have the same question (0)
  • Verified answer
    LeoAlt Profile Picture
    16,331 Moderator on at

    Hi Partner,

    You still could use JS to do this.

    Please refer to the following code and add it on email form onLoad event.

    function setQueue(executionContext) {
        var queueID;
        var queueName;
        var formContext = executionContext.getFormContext();
        var regarding = formContext.getAttribute("regardingobjectid").getValue();
        if (regarding != null && regarding != undefined) {
            var regardingType = regarding[0].entityType;
            var regardingID = regarding[0].id;
            regardingID = regardingID.substring(1, regardingID.length - 1);
            if (regardingType == "incident") {
                Xrm.WebApi.retrieveMultipleRecords("queueitem", "?$select=_queueid_value&$filter=_objectid_value eq "   regardingID).then(
                    function success(result) {
                        for (var i = 0; i < result.entities.length; i  ) {
                            queueID = result.entities[i]._queueid_value;
                        }
                        Xrm.WebApi.retrieveRecord("queue", queueID, "?$select=name").then(
                            function success(result) {
                                queueName = result.name;
                                var value = new Array();
                                value[0] = new Object();
                                value[0].id = queueID;
                                value[0].name = queueName;
                                value[0].entityType = "queue";
                                formContext.getAttribute("from").setValue(value);
                            },
                            function (error) {
                                console.log(error.message);
    
                            }
                        );
    
                    },
                    function (error) {
                        console.log(error.message);
                        // handle error conditions
                    }
                );
                
            }
        }
    }

    And then when you create email from case timeline, the "From" will be set to the queue of the case automatically. It is dynamically, not special.

    pastedimage1600226154189v2.png

    Best Regards,

    Leo

  • dvn92 Profile Picture
    65 on at

    Thank you this works perfectly!

  • empath-e CRM Profile Picture
    1,136 on at

    Hi leo zhang

    We have just come across your response as we have hit the same issue too but it does not seem to work if you manually convert emails from a Queue to a Case as the Case is no longer referenceable in the Queue once it is converted. How does your fix reference back to the Queue the Case was generated from?

  • Zap Objects Profile Picture
    924 on at

    Hi Adam,

    I think you will need to do additional customizations...probably save the queue email in a field in case...
    and then load it when Email form is opened...

    We have done something like this in Zap Helpdesk App too:
    Blog: How New Enhancements (March 2020) to “Quick Email Reply” Section makes it faster for Support Agents to reply back to Customer when using Zap Helpdesk -Email to Case App for Dynamics 365 for Customer Service (link)

    Blog: How to design a Customer Support process when using Dynamics 365 for Customer Service? (link)

  • Suggested answer
    Ian_P Profile Picture
    68 on at

    Great solution thanks.

    If we wanted to use the queue from regarding object if there was a queue, and if not use the Created By Users Default Queue, would that be easy to add to this script?

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 53 Super User 2025 Season 2

#2
Daniyal Khaleel Profile Picture

Daniyal Khaleel 27 Most Valuable Professional

#3
Soundari Profile Picture

Soundari 15

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans