Hi Evgeny,
I have a JSON-RPC library that does something similar to RESTForms. My approach is to have a higher level save method where I can create / modify the object and then call its actual save method.
The problem with modifying the object inside OnBeforeSave() is that the modifications will occur after the validation has been called. The danger being that duff data could get persisted.
The OnAddToSaveSet() will trigger before the validation is called which will bubble up any validation errors correctly.
Alternatively...
Property CreationDate As %Date [ InitialExpression = {+$h} ];
Sean.
- Log in to post comments