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

Create Dynamic Picklists for Your Custom Components (design:component)

Hi, We can expose a component property as a picklist when the component is configured in the Lightning App Builder. The picklist’s value...