In email form we have one button .by clicking thet button open a new tab and then show the all email conversions with the user. by using jscript,html etc.
how can we achieve this please help me to solve this.
In email form we have one button .by clicking thet button open a new tab and then show the all email conversions with the user. by using jscript,html etc.
how can we achieve this please help me to solve this.
Hi nani,
Firstly, you could download a solution called Ribbon Workbench and import it into your CRM, it can help you adding custom button with script to form ribbon.
https://www.develop1.net/public/rwb/ribbonworkbench.aspx
Tutorial about how to add your own script to custom ribbon button.
Then execute script below to open a new window with email context when you click custom button:
var entity = Xrm.Page.data.entity.getEntityName();
var id = Xrm.Page.data.entity.getId().replace('{', '').replace('}', '');
var user = Xrm.Page.context.getUserId().replace('{', '').replace('}', '');
Xrm.WebApi.retrieveMultipleRecords(entity, "?$select=trackingtoken,description&$filter=_ownerid_value eq "+user).then(
function success(result) {
var w = window.open("");
for (var i = 0; i < result.entities.length; i++) {
w.document.write(result.entities[i].trackingtoken+"<hr>"+result.entities[i].description+"<br><br>");
}
},
function (error) {
console.log(error.message);
}
);
Due to email content(Receive and Send) is formatted as HTML source code, so I just output raw HTML source code on new white page in my example,
you could convert them to text with your business requirement.
Regards,
Clofly
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,214 Most Valuable Professional
nmaenpaa 101,156