I've made a plugin that encrypts certain fields on an Account entity prior to saving them to the database. Now, in the UI, I need to call an endpoint I wrote to decrypt them using JavaScript and then display that text in the field (without saving it to the database). I've got the script loaded correctly in Web Resources, it's calling the endpoint onLoad and getting the decrypted value, but I can't figure out how to set it as only the text that's displayed in the field, not as the field value on the actual entity. Is there a better way to do this? If I use
Xrm.Page.getAttribute("my_field").setValue(decryptedValue); Xrm.Page.data.entity.save();
...it obviously saves the value. If I leave off the save(), it doesn't display the text correctly.
Can I use jQuery for this? If so, which fields do I need to set, and using which jQuery method - val, text, html?
Bonus: How can I 1) get the onLoad JS to get called faster and 2) also make this call onBlur?
Thanks in advance!
*This post is locked for comments