You need to sign in to do that
Don't have an account?

trigger not firing please help on event object
senario is that, if we create a new event on a account object then it should update the description field of account. But it is not wokring.
trigger event on Event (after insert) { set<id> ids=trigger.newmap.keyset(); map<id,event> newevents =new map<id,event>(); for(event e1:trigger.new) { if(((String)e1.whatid).startsWith('001')) { newevents.put(e1.id,e1); } } // account acc=[select id,name,description from account where id in:newevents.keyset()]; for(account a1:[select id,name,description from account where id in:newevents.keyset()]) { a1.description=newevents.get(a1.id).location; update a1; } }
While copying ids you are copying event ids not account ids, following is the updated code
Hope it helps you.
Thanks,
Anjith
All Answers
While copying ids you are copying event ids not account ids, following is the updated code
Hope it helps you.
Thanks,
Anjith
thanks,
try this code