You need to sign in to do that
Don't have an account?
sampath palli
Real time scenarios
Hi
Can any one suggest me project based real time scenario's in development which is on Triggers, SOQL , SOSL , Batch apex, Schedule apex and governing limits
Thanks In Advance
Sampath palli
Can any one suggest me project based real time scenario's in development which is on Triggers, SOQL , SOSL , Batch apex, Schedule apex and governing limits
Thanks In Advance
Sampath palli
I will recommend you please try trailhead module for same. IN that you will learn all in a fun a way
1) https://developer.salesforce.com/trailhead/module/database_basics_dotnet
2) https://developer.salesforce.com/trailhead/module/apex_database
Please let us know if this will help you
Thanks
Amit Chaudhary
Create a custom field " Number of Contacts" on Account. This field should hold the number of contacts are associated to the Account and needs to be get updated at all times. pls help me in this
Thanks
Sreeni
Set<ID> accIdSet = new Set<ID>();
// After Insert
if(Trigger.isAfter){
if(Trigger.isUndelete || Trigger.isInsert){
for(Contact c : Trigger.New){
if(c.AccountId != Null){
accIdSet.add(c.AccountID);
}
}
}
if(Trigger.isDelete){
for(Contact c : Trigger.Old){
if(c.AccountId != Null){
accIdSet.add(c.AccountID);
}
}
}
}
List<Account> accList = [SELECT ID, No_of_Contacts__c, (SELECT Id FROM Contacts) FROM Account WHERE Id IN :accIdSet];
if(accList.size() > 0 ){
for(Account a : accList){
a.No_of_Contacts__c = a.contacts.size();
}
update accList;
}
}