- January 16, 2020 at 1:12 pm #66921Aditya #15
What is generic sObject means in Salesforce?
What is generic sObject means?
January 16, 2020 at 1:26 pm #66924Marziya #11
- This topic was modified 5 days, 4 hours ago by Aditya.
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.January 16, 2020 at 1:30 pm #66928Arun Pal #12
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.January 20, 2020 at 2:07 pm #67044Aditya #15
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.January 20, 2020 at 2:59 pm #67066Kirandeep #24
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];
SObject con = [Select Id, Name from Contact limit 1];
system.debug(GenericList);January 20, 2020 at 7:58 pm #67075MOHIT #20
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.
If you’ve added custom objects in your organization, use the API names of the custom objects in Apex.
Please Register to reply to this topic. /