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 :
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

Set Email "From" Field to General Support Email

(0) ShareShare
ReportReport
Posted on by 45

I am trying to set the email "From" field to a specific email address/user OnLoad.  I have done something similar for the "Subject" field using javascript and added it as web resource to the form but I've been unsuccessful in doing so for the "From" field.  I do not know javascript specifically but I know enough to modify it for my needs if I find something similar that someone has written.  That is how I achieved the "Subject" line fix.  Does anyone know how I can set the "From" field on the email form to a specific user OnLoad? I don't believe I can get a flow to do this but if someone knows a way I am all ears!

Any help is greatly appreciated.

Thanks!

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at

    Hi lawilliams713,

    You can use the following js code: 

    function setSender(executionContext) {
        var formContext = executionContext.getFormContext();
        var lookup = new Array();
        lookup[0] = new Object();
        lookup[0].id = "8c68629d-5555-ec11-8f8f-000d3a5b22fe";
        lookup[0].name = "Eric Gruber (Sample Data)";
        lookup[0].entityType = "systemuser";
        formContext.getAttribute("from").setValue(lookup);
    }

    Result:

    pastedimage1647488168870v1.png

    Note:

    pastedimage1647488497701v2.png

  • lawilliams713 Profile Picture
    45 on at

    Ah! So simple!!!  Worked like a charm.  Thank you!

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 > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Martin Dráb Profile Picture

Martin Dráb 60 Most Valuable Professional

#2
#ManoVerse Profile Picture

#ManoVerse 51

#3
Satyam Prakash Profile Picture

Satyam Prakash 42

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans