So far we know how to insert, update and view our Mbo records, so the next step is to delete a record.
You delete Mbo’s by calling the delete() method. This method removes the current Mbo from an MboSet. Basically the Mbo is not delete when you call the delete method it is more over marked for deletion. The real delete operation is executed when the transaction is commit to the database. In general this is the save operation on the MboSet.
Here comes an example which deletes a specifc Workorder from the Workorder MboSet:
# Example: Delete a specific Mbo woset = session.getMboSet('WORKORDER') woset.setWhere("WONUM = '2009'") woset.reset() wo = woset.moveFirst() if wo is not None: # Mark Mbo for deletion wo.delete() # Real delete is done at this point woset.save()