Wednesday, May 14, 2014

How to initialize SObject

SObjects are very use full in managed packages and dynamic code scenarios. But when it comes to use it we are in bit of a confusion. There are many ways we can initialize SObject as :
  1. Direct initialize - sobjects can be directly initialize to a existing Standard or Custom object.
  2. Dynamic initialize - we can decide object type by passing string to  Schema.SObjectType.
Examples: 

No comments:

Post a Comment