Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM forum
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 362 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 362 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,962 Moderator 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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,554 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,588 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans