You need to sign in to do that
Don't have an account?
Error: Compile Error: Method does not exist or incorrect signature.....REMOVE(Cc.Id)
Hi All,
I am getting the above error on my trigger (wrote a class and then added the class to my trigger) and I can't figure out how to resolve. All help is so greatly appreciated!
Error: Compile Error: Method does not exist or incorrect signature: ContactExtIdUpdates.updatecalled.remove(Id) at line 6 column 72
Class:
I am getting the above error on my trigger (wrote a class and then added the class to my trigger) and I can't figure out how to resolve. All help is so greatly appreciated!
Error: Compile Error: Method does not exist or incorrect signature: ContactExtIdUpdates.updatecalled.remove(Id) at line 6 column 72
Class:
public with sharing class ContactExtIdUpdates { public static set<ID> updatedcalled = new set<id>(); }Here is the trigger and location of the error:
trigger ContactID on Contact (before insert, before update, after update, after delete) { // creates a "lock" by adding the object Id into the "updatecalled" set of IDs. for (Contact Cc : Trigger.New) { if (Trigger.isAfter) { if (!ContactExtIdUpdates.updatecalled.Contains(Cc.Id)) ContactExtIdUpdates.updatecalled.remove(Cc.Id); //Removes lock once updated <------THIS LINE IS CAUSING ERROR } else if (!ContactExtIdUpdates.updatecalled.Contains(Cc.Id)) {//Checks lock, executing code only if no lock ContactExtIdUpdates.updatecalled.Add(Cc.Id); //Adds lock //
Remove that boolean varible.
I used that to test the trigger.
No need to change your class.
Thanks.
All Answers
public with sharing class ContactExtIdUpdates
static.
public static set<ID> updatedcalled = new set<id>();
}
Error: Compile Error: ContactExtIdUpdates: Types cannot be marked as static at line 6 column 21
Well that's simplae spelling mistake.
ContactExtIdUpdates.updatecalled.remove(Cc.Id); //Wrong
ContactExtIdUpdated.updatecalled.remove(Cc.Id);//Right
The list name defined in the class is updatedcalled not updatecalled.
Use this code.
Thanks.
Remove that boolean varible.
I used that to test the trigger.
No need to change your class.
Thanks.
There is no such variable "updatecalled" in the class ContactExtIdUpdates .
you have updatedcalled. See the difference between these to names.
Static in salesforce works for context.