You need to sign in to do that
Don't have an account?
Adelchi Pelizzo
Method does not exist or incorrect signature: createData()
I have this small piece of code here:
I do not understand why when I execute anonymously just the mothod <createData()> I get the above error: Method does not exist or incorrect signature
public class CreateDataFiscCode { public Contact createData(){ Contact contact = new Contact ( FirstName = 'Paolo', LastName = 'Polio', Birthdate = date.parse('12/12/1912'), Birthplace__c = 'Attimis', Provincia__c = 'UD', Sesso__c = 'M' ); insert contact; return contact; } }
I do not understand why when I execute anonymously just the mothod <createData()> I get the above error: Method does not exist or incorrect signature
Am not sure how you are calling in your anonymous block, but this should work:
Alternatively, you can declare the createData function as static to call it directly without instantiating the class variable.
===
If your problem/query is resolved, please mark your post as "Solved" so that community can benefit from resolved posts.