var emailtemplate = {
id: "fd015726-c13a-ef11-840a-6045bd03efbc",
objectId: formContext.data.entity.getId(),
objectTypeCode: "template"
};
var data = {
// Populating Subject line
"subject": "Interest in HOOPP",
// Populating Dynamics Generated column
"sksysdev_dynamicsgenerated": true,
// Populating To column with Lead
"to": [
{
"entityType": formContext.data.entity.getEntityName(),
"id": formContext.data.entity.getId(),
"name": formContext.data.entity.getPrimaryAttributeValue()
}
],
};
// Define the parameters for the form
var pageInput = {
pageType: "entityrecord",
entityName: "email", // Target entity logical name
data: data,
templateid: emailtemplate,
formId: "213b35fa-3e2e-ef11-840b-6045bd03efbc",
createFromEntity: {
"entityType": formContext.data.entity.getEntityName(),
"id": formContext.data.entity.getId(),
"name": formContext.data.entity.getPrimaryAttributeValue()
}
};
// Define the navigation options
var navOptions = {
target: 2,
height: {value: 80, unit:"%"},
width: {value: 70, unit:"%"},
position: 1
};
// Perform the navigation
Xrm.Navigation.navigateTo(pageInput, navOptions).then(
function success(result) {
// Called when the dialog closes
},
function (error) {
text: error.message;
}
);
}

Report
All responses (
Answers (