You need to sign in to do that
Don't have an account?
Emsegal
Newbie question: Method does not exist or incorrect signature:
I am getting the above error message on a trigger. I have stripped the trigger way way down to make it easier to diagnose the problem.
Here is the complete trigger
trigger tryi on Contact (before update) {
string gCode;
string en;
en='Segal';
gCode=LEFT(en,2);
}
and here is the complete error:
Error: Compile Error: Method does not exist or incorrect signature: LEFT(String, Integer) at line 5 column 11
But I know that LEFT exists, and I know that 'Segal' is a string, and I know that 2 is an integer. So what am I missing?
Thanks.
I think you want to use substring (
http://www.salesforce.com/us/developer/docs/apexcode/index_Left.htm#StartTopic=Content/apex_methods_system_string.htm?SearchType=Stem)
All Answers
I think you want to use substring (
http://www.salesforce.com/us/developer/docs/apexcode/index_Left.htm#StartTopic=Content/apex_methods_system_string.htm?SearchType=Stem)
I clicked on the accepted solution button thinking that I could not accept a solution for someone else but I guess you can...sorry about that.
...but yes, you will have to use a function within the string class.
Good Answer @kpeters
The odd thing is, there's supposed to be a left() method on strings. It's in the documentation
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_string.htm
But, the example in the documention doesn't work!
Inside execute anonymous returns:
Compile error at line 2 column 13
Method does not exist or incorrect signature: [String].left(Integer)