You need to sign in to do that
Don't have an account?
Alejandro Gonzalez 18
Why is this method signature is not recognized?
I am creating an utility class for lists and sets. A centralized static place where i can Where clauses and select, similar to linq
verything works with Lists, But when i try this following signature.
That fails with the compile error
Method does not exist or incorrect signature: void WherePropertyEqualsSet(Set<RoleToAdd__c>, String, Object) from the type AddUserListUtility
Im baffled as the signatures seem to match.
Btw using List types work.
verything works with Lists, But when i try this following signature.
class AddUserListUtility{ public static Set<SObject> WherePropertyEqualsSet(Set<SObject> source, string propertyName, object value) { ... } } -- now the calling part. -- for(string rile : record.Roles__c.split(';')) { object converted = rile; AddUserListUtility.WherePropertyEqualsSet(AllRoles, 'Role__c', converted); }
That fails with the compile error
Method does not exist or incorrect signature: void WherePropertyEqualsSet(Set<RoleToAdd__c>, String, Object) from the type AddUserListUtility
Im baffled as the signatures seem to match.
Btw using List types work.
To kepp it generic use SObject not Object . Object is a System object not used to store any TYPE value into it. Here is the code I see for Object class.
If you are checking 2nd and 3rd params are equal or not then you should change your Method signature to the below.
And your for loop should be like below.
notice the only change was using a List vs a set.
Also using object as a parameter is the way to make them generic. All primitive datatype inherit from the Object class. Using Object is the way of using it generic. Also forcing it to be an SObject will not let me use columns that are Integers or boolean, which is the point of this.