We try to set address fields in the before saving company event. Basically, we simply want to copy street address to postal address if postal address is not set by the user.
EventData ed = getEventData();
ed.setMessage(ed.getInputValue("ContactEntity.Address.LocalizedAddress.Value")); // Read address fields: OK
ed.setOutputValue("ContactEntity.Address.LocalizedAddress.Value","Hello"); // Write address fields: issues error (object does not exist)
ed.setOutputValue("ContactEntity.UserDefinedFields.SuperOffice:2","XX"); // Write udef field: OK
Thus, we can read address fields, as well as read and write user defined fields. However, whenever we attempt to write an address field an error appears, and the company is left unchanged.
Interestingly, we are able to set address fields of a ContactEntity object as expected, e.g. in the after saving company event. But then the object is not refreshed by the browser, so the user does not see the effect.
1. Why does setOutputValue("ContactEntity.Address.LocalizedAddress…) not work?
2. Is it possible to force a refresh of the browser in an after saving event? And if so, how?