Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Answered

Autopopulate email recipient field from custom entity

Posted on by 20

Hi,

I need to configure Dynamics to auto-populate the "To" field when sending an email from a custom entity. What is the best way to do this?

pastedimage1648227420215v1.png

  • KaterinaD Profile Picture
    KaterinaD 20 on at
    RE: Autopopulate email recipient field from custom entity

    You should add this script in the Form Properties of the form that contains the lookup field to the onLoad event.

  • Daniel_5426 Profile Picture
    Daniel_5426 10 on at
    RE: Autopopulate email recipient field from custom entity

    Where do I enter this code?

  • Suggested answer
    KaterinaD Profile Picture
    KaterinaD 20 on at
    RE: Autopopulate email recipient field from custom entity

    I was able to populate the field by using this script:

    // *** Function to set a party list

    function setToPartyList(fieldName, id, name, entityType) {

     var party = Xrm.Page.getAttribute(fieldName);

     // Create new array

     var partlist = new Array();

     partlist[0] = new Object();

     partlist[0].id = id;

     partlist[0].name = name;

     partlist[0].entityType = entityType;

     // Set array value

     party.setValue(partlist);

    };

  • Hammed Profile Picture
    Hammed 366 User Group Leader on at
    RE: Autopopulate email recipient field from custom entity

    Please how did you solve this probs with JS as i have similar request.

  • Hammed Profile Picture
    Hammed 366 User Group Leader on at
    RE: Autopopulate email recipient field from custom entity

    How did you achieve this?

    I have a similar requirement. Could you please share the script?

    I will really appreciate.

  • KaterinaD Profile Picture
    KaterinaD 20 on at
    RE: Autopopulate email recipient field from custom entity

    Тhank you for the answers. I was able to successfully do this with JavaScript code.

  • Verified answer
    Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: Autopopulate email recipient field from custom entity

    Hi,

    You should write javascript code to achieve what you need.

    neilparkhurst.com/.../

    Please mark my answer verified if this is helpful!

    Regards,

    Bipin Kumar

    Follow my Blog: xrmdynamicscrm.wordpress.com/

  • KaterinaD Profile Picture
    KaterinaD 20 on at
    RE: Autopopulate email recipient field from custom entity

    Тhe request is to be able to send an email directly from the form of the custom table to the primary contact of the corresponding Account.

    What is the most appropriate way to do this?

  • Suggested answer
    RE: Autopopulate email recipient field from custom entity

    If you're composing an email from another record, you may be able to do it with field mapping.
    If not, I think it can be done by customizing the form.

    docs.microsoft.com/.../form-onload

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