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

Error on case Trigger
Hi All,
I am working on the case trigger which will update an acount object.I just started and got the folowing error.Can somebody help?
In the below given code I am assigning accountid to the map and along with the acocuntid I am trying to the add the complete record in map.However,When I
do that I get the following error.I want to use map here so I will appreciate if somebody can correct this error.I do not want ot use set or list here.
Method does not exist or incorrect signature: [MAP<String,Case>].add(Id, SOBJECT:Case) at line 7 column 18
Trigger UpaatingPicklist on Case (After insert,after update)
{
Map<String,case> cap=new Map<String,case>();
for(case c:trigger.new)
{
cap.add(c.accountid,c);
}
}
I also swapped a few other thing such as the map keys:
trigger UpatingPicklist on Case (After insert,After update)
{
Map<ID,sObject> cap=new Map<ID,sObject>();
for(Case c:trigger.new)
{
cap.put(c.accountid,c);
}
}
Let me know if that helped.
Cheers,