🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
OCLOperators delete
Created by Stephanie on 2025-01-08 · Last edited by Hans.karlsen on 2026-04-17.

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 suing self.CascadeFetch prior to deletion to control rouge fetching