What is an MObject?
MObjects are short for Managed Objects, peer of SObjects. MObjects have similar data as SObjects.
The difference between MObjects and SObjects is that MObjects track the changes and will flush the changes to persistence later.
| Aspect | MObject | SObject |
|---|---|---|
| Field Access | Support nested field access through method calls | Direct field access through '.' |
| Field Update | Support field update through method calls | Reference and relationship fields cannot be updated directly |
| DML Operations | Can be done in one method call | Have to sort out SObjects before doing DML operations |