function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sreenathsreenath 

What is sObject? I need with example.

I am new to apex programming first. we are having standard objects like accounts,contacts,opportunities....

& we can create custom objects with the extension of "__c". I observed in the programming the sObject but i am not understanding clearly about sObject concept. Anyone can please help me at this part.

                                              Thanks, in Advance...

Best Answer chosen by Admin (Salesforce Developers) 
Imran MohammedImran Mohammed

Generic sObject means, it can be of any persisted SFDC objects type.

For ex: Vehicle is generic type and Car, Motor Bike all are concrete types of Vehicle.

In SFDC,sObject is generic and Account, Opportunity, CustomObject__c are its concrete type.

Generic sObject abstracts the actual representation of any object assigned to it. sObject is the name of the generic abstract type that can be used to represent any persisted object type.

 

Let me know if you still have any doubts.

All Answers

Imran MohammedImran Mohammed

In SFDC, any object either it be Standard or Custom is a sObject.

Every custom object created will have an extension __c. This will be helpful in distinguishing the SFDC standard objects with User created custom objects.

You can find more details on the SObject in Apex Documentation.

 

sreenathsreenath

Hi Imran,

              I read the documentation now, I understand that its a temporary declaration of an object regarding lists, DML queries. Its a generic object which point out the created instance. please clear my doubt as its a generic object.

Imran MohammedImran Mohammed

Generic sObject means, it can be of any persisted SFDC objects type.

For ex: Vehicle is generic type and Car, Motor Bike all are concrete types of Vehicle.

In SFDC,sObject is generic and Account, Opportunity, CustomObject__c are its concrete type.

Generic sObject abstracts the actual representation of any object assigned to it. sObject is the name of the generic abstract type that can be used to represent any persisted object type.

 

Let me know if you still have any doubts.

This was selected as the best answer
sreenathsreenath

Thanks Imran,

               Thank you very much for your detailed description about some basic point of object. i am reviewing all the standard docs from community.

karthik tantrykarthik tantry
sObject in Salesforce is just imagined as a table taken into memory. This table might be a instance of account, Contact or oppurtunity. The Object "Account" is referenced filling the empty table "sObject" with Account Object type.
Janakiraman ElumalaiJanakiraman Elumalai

The normal object for a class in c++ or Java is refered as sObject in apex.
Ex: A a; a --> object in c++;
             a --> sObject in Apex;

ganesh patil 42ganesh patil 42
@Janakiraman Elumalai sobject means is the super class for all other classs....like in java class Object is super class for other class....