• 1Installation
  • 2Preliminary Knowledge
  • 3Create MObjects
  • 4Manipuate MObjects
  • 5Delete MObjects
  • 6Persistence
  • 7Namespace Free
  • 8Functional Support

MObject.apex

  • Docs
  • Tutorials
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.

Done