Hello everyone,
I have written a custom JS script to apply a value to a hidden field on the Email entity form and then save it with JS, however, after some tests I have discovered that the body of the email as well as Subject are being cleared. Have anyone encountered the same problem and are there any suggestions/ ideas what could be wrong? I have also tried to use the Xrm.Page method, but as I understood it is deprecated and that the formContext.data.save() method should be used instead.
Here's the JS script:
function setfield(executionContext) { var formContext = executionContext.getFormContext(); console.log("setFieldValue"); var createdBy = Xrm.Page.getAttribute('createdby').getValue(); var bcc = Xrm.Page.getAttribute('FIELD').setValue(createdBy); formContext.data.save(); }
By the way the CRM is on-premise 8.2 version (8.2.2.112)
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... 290,522 Super User 2024 Season 2
Martin Dráb 228,441 Most Valuable Professional
nmaenpaa 101,148