Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

When sending a email from Cases I want the "To" field on the email to be the Contact field or a custom "Lead" lookup field instead of customer

(0) ShareShare
ReportReport
Posted on by 2,148

Hi all,

I've been trying to find a solution for this online but to no avail.

I've created a custom lookup field on cases pointing to Leads and what I wanted to do was when someone creates a email from the Case timeline, that it defaults the "To" field to the "Lead" field as opposed to the Customer field. The reason is that I want the customer field to store the Account.

Is there anyway to do this?

Kind regards,

Mike

  • Verified answer
    Seenivasan M Profile Picture
    307 on at
    RE: When sending a email from Cases I want the "To" field on the email to be the Contact field or a custom "Lead" lookup field instead of customer

    Hi,

    Yes. You can update custom field value (contact or Lead Lookup field) to Email "To" by using JavaScript.

    Please follow below steps,

    Entity: Email

    Event: On load

    1. Get the Email record “Regarding Object” field value (must be case record (id). Since, you are trying to send email from case)

    2. Retrieve your custom lookup field value from case record by using this case record id(regarding object, JavaScript- GET method)

    3. Update the email “TO” with your retrieved custom file value(contact/lead lookup field)

    Please mark my answer as verified if this solution meet your requirement/resolve your issue.

  • Suggested answer
    gupta.ambar2009@gmail.com Profile Picture
    797 on at
    RE: When sending a email from Cases I want the "To" field on the email to be the Contact field or a custom "Lead" lookup field instead of customer

    OOB not possible...

    write custom logic ..

  • Community Member Profile Picture
    on at
    RE: When sending a email from Cases I want the "To" field on the email to be the Contact field or a custom "Lead" lookup field instead of customer

    Hey Mike,

    We are into Dynamics 365 CRM Development. I hope the below links can help you overcome this problem. Please have a look. Also, you can email us your specific requirement at info@solzit.com

    www.solzit.com/.../

    www.solzit.com/.../

  • Verified answer
    Rawish Kumar Profile Picture
    13,758 on at
    RE: When sending a email from Cases I want the "To" field on the email to be the Contact field or a custom "Lead" lookup field instead of customer

    Hi Mike,

    Its by design and i'm afraid there is no out of the way to achieve it.  and if there is any, you may not want it because on email the to field should be customer id.

    what you should do is. on Onload of the email page, you will have "case" record set. Take the id of the record and retrieve the lead and set it on the "to" field.

    couple of examples how to do that:

    you can use rest builder to generate the script :github.com/.../releases

    passion4dynamics.com/.../

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 225 Super User 2025 Season 1

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 106

#3
Vahid Ghafarpour Profile Picture

Vahid Ghafarpour 82 Super User 2025 Season 1

Overall leaderboard

Product updates

Dynamics 365 release plans