Saturday, 10 March 2012

Rollup Summary using Trigger

//Rollup summary using trigger on conatct
//This is used for  displaying the number of contacts on account

trigger countingcontacsofacc on Contact (after insert,after delete,after update) {
map<id,list<contact>> mapcontactcount=new map<id,list<contact>>();
map<id,Account> accupdate = new map<id,account>();
for(Account acc:[select id,(select id,name from contacts) from account]){
        accupdate .put(,acc);

for(id c:mapcontactcount.keyset()){
update accupdate.values();


No comments:

Post a Comment

Refresh Interval of different types of Sandboxes

Hi, We have different refresh intervals for different sandboxes as shown below. Sandbox Type Refresh Interval ...