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...
Unanswered

Email message setFocus() issue

(0) ShareShare
ReportReport
Posted on by
Recently a change in the code for this code has been introduced (only in our production environment): EmailIntelligence/EmailSentiment/msdyn_EmailSentiment.js
This happens for all emails, both when choosing reply and also creating an email from blank.
The block of code appears at rows 434-444 and sets the focus from the body to the "To" field instead, resulting in annoyance from the business.
I'd prefer to avoid solving this with a script changing the focus after this code has been run, any ideas how to fix?
 
Said block of text in the file is this:
            // Set focus to the "To" field for new/draft emails so the focus order
            // follows the logical visual layout (To -> Cc -> Subject -> Body).
            var formType = formContext.ui.getFormType();
            var statusCodeAttr = formContext.getAttribute("statuscode");
            if (formType === 1
                || (formType === 2 && statusCodeAttr && statusCodeAttr.getValue() === 1)) {
                var toControl = formContext.getControl("to");
                if (toControl) {
                    toControl.setFocus();
                }
            }
This appears in the function EmailIntelligence.
 
Below is the difference in code, left is dev and right is prod:
I have the same question (0)

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

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

#1
FSRon Profile Picture

FSRon 72

#2
James White Profile Picture

James White 23

#3
11manish Profile Picture

11manish 22

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans