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 CRM (Archived)

"Reply All" included receiver email address in "To"

(0) ShareShare
ReportReport
Posted on by 540

Hi all,

I am trying to reply email from CRM to sender.

In my case, [To: CRM UAT1 CRMAdmin Adm crmuat1@XXXXXXX]

CRM UAT1 is a contact, which has a email address of crmuat1@XXXXXXX, this contact is auto created by CRM when the email received.

CRMAdmin Adm is a user, whose email address is crmuat1@XXXXXXX

This email is sending from XXXXXX@hotmail.com to crmuat1@XXXXXXX(received by CRM)

a2.jpg

Then I clicked "REPLY ALL"

The "CRM UAT1" and "crmuat1@XXXXXXX" will automatically added to the "To" field

Actually, I would like the "REPLY ALL" auto filled "To, Cc (if any)" fields, but do not include the original receiver in the "To" field, is it possible? Is there an option in CRM to set? It is quite annoying to remove it every time by myself.

Thank you very much!!

Regards,

Doll

*This post is locked for comments

I have the same question (0)
  • Saroj Das Profile Picture
    3,355 on at

    Hi Doll, please check the below link. This might help you.

    msdn.microsoft.com/.../hh372955.aspx

    Regards,

    Saroj

  • Saroj Das Profile Picture
    3,355 on at

    Hi Write a javascript function for form onload to remove the field.

    i.e.

    Xrm.Page.getAttribute(<lookup_Attribute>).setValue(null);

    HTH

    Regards,

    Saroj

  • Doll Doll Profile Picture
    540 on at

    Hi Saroj,

    Thank you for your reply.

    I would like to take the JavaScript approach,

    however I am stuck with getting the value of the "To" field

    Here is my code

    function removeReceiverAtTo(){

    var tofield = Xrm.Page.getAttribute("to").getValue();

    alert(tofield);

    //tofield= tofield.replace("CRM UAT1", "");

    //Xrm.Page.getAttribute("to").setValue(tofield);

    }

    When I alert the variable, it returns [object Object] only,

    I would like to check if the variable "tofield" contains CRM UAT1, then remove it, and leave the rest in the "To" field.

  • Saroj Das Profile Picture
    3,355 on at

    Hi Doll, are you using crm field schema name in getAttribute Method.    i.e.

    Xrm.Page.getAttribute(“your CRMFieldSchemaName”).getValue() ; and one more thing if your to field is a lookup, then try this. 

    var lookupObject = Xrm.Page.getAttribute(“CRMLookupSchemaName”).getValue();
    alert(lookupObject[0].name); // text of lookup
    alert(lookupObject[0].id);

    Thanks,

    Saroj

  • Doll Doll Profile Picture
    540 on at

    Hey Saroj,

    I believe that I am on the way to success:)

    Still a minor problem....

    When I remove one of the key in the object, it returns "undefined"

    function removeReceiverAtTo(){
    	var tofield = Xrm.Page.getAttribute("to").getValue();
    	
    	if(tofield[0].name == "CRM UAT1"){
    		delete tofield[0];
    	}
    
    	Xrm.Page.getAttribute("to").setValue(tofield);
    }


    Can you point me to the correct way?

    Thank you very much!!

    Doll

  • Saroj Das Profile Picture
    3,355 on at

    Hi Doll, try like this and let me know.

    if(tofield[0].name == "CRM UAT1"){

    delete tofield[0].name;

    //or  you can do like this

    Xrm.Page.getAttribute("to").setValue(null);

    }

    Thanks

    Saroj

  • Doll Doll Profile Picture
    540 on at

    Hi Saroj,

    Actually, I tried something like this ,

    function removeReceiverAtTo(){
    	var tofield = Xrm.Page.getAttribute("to").getValue();
    	
    	if(tofield[0].name == "CRM UAT1"){
    		delete tofield[0].name;
    		delete tofield[0].id;
    		delete tofield[0].entityType;
    	}
    
    	Xrm.Page.getAttribute("to").setValue(tofield);
    }


    It returns the same result, undefined in the to field

  • Doll Doll Profile Picture
    540 on at

    Oh, missed.

    I also cannot Xrm.Page.getAttribute("to").setValue(null);

    I would like to keep the original sender of the email:)

  • Saroj Das Profile Picture
    3,355 on at

    Hi Doll, Please use below instead of delete

    Xrm.Page.getAttribute("to").setValue(null);

    Thanks,

    Saroj

  • Saroj Das Profile Picture
    3,355 on at

    Hi Doll, what i understand is you want to keep your tofield like this

    abc@testmail.com, xyz@testmail.com, someone@testmail.com.

    am i right. In toField also you are adding Original Sender. Please elaborate little more if i am wrong.

    Thanks,

    Saroj

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 CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans