Getting started with MObject.apex
Create MObjects
MObjects are peers of SObjects, and we can create MObjects in multiple ways.
// From SObject
MObject mo = MObject.create(new Pricebook2());
// Create default MObject from SObject type
mo = MObject.create(Pricebook2.sObjectType);
// Create an MObject from a map
mo = MObject.create('Pricebook2', new Map{ ... });
// Create a list of MObjects
List mos = MObject.createList(new List{ ... }); If created MObjects do not have 'Id' fields filled, they are considered as New MObjects and insertion operation will be carried out for the New MObjects during persistence.