Professional Documents
Culture Documents
319-23 Sobjects Sobject:: Example Name Rating Ownership Type Active - C
319-23 Sobjects Sobject:: Example Name Rating Ownership Type Active - C
319-23 Sobjects Sobject:: Example Name Rating Ownership Type Active - C
===========================================
Sobject:
===========================================
1. Every table created in the salesforce database is called sobject in Apex programming
2. Every sobject has equilent apex class
3. We will reffer to table/sobject using the apex class
Example :
Sobject Name Apex class
-------------------------------------------------------------
Account Account
Contact Contact
Loan__c Loan__c
Customer__c Customer__c
Second format
Account acc =new Account(Name='Dell',Rating='Warm',Type='Existing',Active__c='Yes');
Third Format :
Account acc =new Account();
acc.put('Name','Wipro');
acc.put('Rating','Hot');
acc.Put('ownership','Public');
acc.put('Type','New Customer');
Example : Create a sobject Opportunity with following data
city__c='Hyd',Age__c=30);
--------------------------------------------------------------------------------------------------------------------------------------------------
============================================================
TYPE CASTING
:============================================================
Object a =10;
object b='Satish';
Object c =Date.newInstance(2019,2,23);
============================================================
Wrapper Class:
============================================================
1. it is a apex class .
2. it contains only datamembers
3. It is used to create user defined datatypes.
Example :
global/public class ClassName{
datamembers
}
6. Create a wrapper class which will take account ,contact and opportunity
public class Example{
public Account acc;
public Contact con;
public Opportunity opt;
}
8. Create a wrapper class which will take Account and boolean value,