on click of reply, reply all and forward in email message, need to update the description with some content. I am able to update the content while debugging in console but it is not working while doing by code. calling the below script in onload function. Any help would be appreciated to resolve this.
if (formType == 2) {
var regardingObject = Xrm.Page.getAttribute("regardingobjectid").getValue();
var subject = Xrm.Page.getAttribute("subject").getValue();
if (regardingObject != null && regardingObject != "" && regardingObject != undefined) {
if (regardingObject[0].entityType == "entityname" && (subject.indexOf("RE: ") != -1 || subject.indexOf("FW: ") != -1)) {
includeSignature();
}
}
}
function includeSignature() {
var description = Xrm.Page.getAttribute("description").getValue();
var currentUser = Xrm.Page.context.getUserName();
Xrm.Page.getAttribute("description").setValue("<p style='font-family: Arial; font-size: 10pt;'>Dear <br><br> Please do not reply directly to this email. To reply, please click <a href='url'>link1</a>.<br><br>Best Regards" + "<br>" + currentUser + "<br></p><p style='font-family: Arial; font-size: 8pt;'>Privileged or confidential information may be contained in this email. If you have received this mail in error, please delete it and notify the sender.</p>" + description);
Xrm.Page.getAttribute("description").setSubmitMode("always");
Xrm.Page.data.entity.save();
}
Kindly help me if am missing something.
Thanks
*This post is locked for comments
I have the same question (0)