OCLOperators OnUpdate
No edit summary
No edit summary
Line 13: Line 13:
  endif  
  endif  
See more: [[Acting on object changes]], [[OCLOperators IsDirty|IsDirty]]
See more: [[Acting on object changes]], [[OCLOperators IsDirty|IsDirty]]
See also [[OCLOperators OnCreate|OnCreate]], [[OCLOperators OnDelete|OnDelete]], [[OnStateChange]]

Revision as of 13:20, 5 April 2022

OnUpdate is called just before the onbject is saved to database. Here you can do things needed on every save operation.

Please note!

You can't create new objects from within then OnUpdate action. That will leave the newly created object unsaved.

For example, in the method body for OnUpdate set this ocl:

if self.existing then -- This avoids touching the object if it has been deleted  
  self.ChangeTime:=DateTime.Now; 
  false 
else  
  false 
endif 

See more: Acting on object changes, IsDirty

See also OnCreate, OnDelete, OnStateChange

This page was edited 47 days ago on 02/10/2024. What links here