🚀 Welcome to MDriven Learn –  Don’t miss the latest Release Notes.
OCLOperators delete

The delete operator removes (deletes) an object from persistence. When an object is deleted, it becomes marked for removal and will be permanently removed after the next save operation.

Use delete in a ViewModel Action or in the OCL/PS ExecuteAndDebug tool.

Example

Delete a single object

self.delete

Delete the first Customer

Customer.allInstances->first.delete

Also consider using self.CascadeFetch prior to deletion to control rogue fetching