Hi all,
Just a quick one. I've got a JavaScript web resource that updates fields of a related entity record from a lookup field on the primary entity record. There are 2 fields that need updating/syncing across the related entity records.
I've then set the web resource to load on change of each of the 2 fields on the primary entity record. The problem is that how I've got the javascript set is that it will update both fields everytime a single field is changed as the script statically sets the attribute values.
What I thought about is whether there's a way to dynamically pass the attribute name as a variable so that when that attribute changes value I only need to update the one field that's changed as opposed to both of them everytime.
As an example of the below code:
function attributeTest (executionContext){ var formContext = executionContext.getFormContext(); // You can see I'm statically getting the attribute one value by inputting the logical name of that attribute var attributeOneValue = formContext.getAttribute("new_attributeone").getValue(); // I want to see if it's possible to pass the "new_attributeone" logical name as a parameter or variable so that I can dynamically get values of the field that's being changed. }
Kind regards,
Mike