Activity › Forums › Salesforce® Discussions › What is generic sObject means in Salesforce?
-
What is generic sObject means in Salesforce?
Posted by Aditya on January 16, 2020 at 1:12 PMWhat is generic sObject means?
-
This discussion was modified 6 years, 4 months ago by
Aditya.
MOHIT replied 6 years, 4 months ago 5 Members · 5 Replies -
This discussion was modified 6 years, 4 months ago by
-
5 Replies
-
In SFDC, SObject is generic and Account, Opportunity, CustomObject__c are its concrete type. Generic sObject abstracts the actual representation of any objectassigned to it. sObject is the name of the generic abstract type that can be used to represent any persisted object type.
- [adinserter block='9']
-
sObject is a generic data type. Every record in Salesforce is natively represented as an sObject in Apex. Any object you store in salesforce organization can be sObject. In a simple language, It is a big object in which you can store any object.
-
sObject is a generic abstract type that corresponds to any persisted object type. The generic sObject can be cast into a specific sObject type, such as an account or the Invoice_Statement__c custom object.
-
Hi ,
Generic sObject means, it can be of any persisted SFDC objects type.
For ex: Phone is generic type and Samsung,Nokia all are concrete types of Phone.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.For example :-
List<SObject> GenericList = new List<SObject>();
SObject acc = [Select Id, Name from Account limit 1];
GenericList.add(acc);SObject con = [Select Id, Name from Contact limit 1];
GenericList.add(con);system.debug(GenericList);
-
Every record in Salesforce is natively represented as an sObject in Apex.
Each Salesforce record is represented as an sObject before it is inserted into Salesforce. Likewise, when persisted records are retrieved from Salesforce, they’re stored in an sObject variable.
Standard and custom object records in Salesforce map to their sObject types in Apex. Here are some common sObject type names in Apex used for standard objects.
Account
Contact
Lead
Opportunity
If you’ve added custom objects in your organization, use the API names of the custom objects in Apex.
Log In to reply.