Activity Forums Salesforce® Discussions Casting Generic sObjects to Specific sObject Types in salesforce?

  • Suraj

    Member
    April 6, 2017 at 5:05 am

    Hi Manpreet,

    sObject refers to any object that can be stored in the Force.com platform database.The sObject data type can be used in code that processes different types of sObjects.

    You can assign particular type object to generic for e.g

    sObject s = new Account();

    But You can't assign Generic type Object to Particular(Account) Object For e.g

    Account a =s;    This will give error so you need to type Cast this to

    Account a=(Account)s;

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos