You need to sign in to do that
Don't have an account?
tganikumar
Problem with Account object...
Hi,
In my environment Account object is not working. Means i written a class like below:
public class example{
public example(){
Account a = new Account();
Contact c = new Contact();
}
}
after clicking save it is giving following error:
Error: Compile Error: Constructor not defined: [account].<Constructor>() at line 3 column 21
Can you resolve anyone ASAP?
Do you have a custom class named Account by any chance?
All Answers
please let me know which Salesforce.com API version are you using?
please change your version.
Are you using this class as a Controller for any visualforce page? Check with that and let me know.
Do you have a custom class named Account by any chance?
Yes bob, your are right? But, why it is giving an error? I think the my class is overriding the standard class...
can you explain in detail?
No, but I written the class named as Acount. Then after delete that class it is working fine. But, why it is giving that error? Can you explain in detail?
Your class will override the standard sobject.
This is documented at:
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_namespace_prefix.htm
in the Namespace, Class and Variable Name Precedence section.
You can explicitly refer to the sobject via 'System.Account', but I tend to avoid these naming clashes as it makes maintaining the code tricky.