Discussions
- General Development
- Schema Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules
- Security
- Mobile
- Force.com Sites & Site.com
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby
- Desktop Integration
- APIs and Integrations
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- AppExchange Directory & Packaging
- Salesforce Labs & Open Source Projects
- Other Salesforce Applications
- Jobs Board
- Force.com Discussion Boards
- :
- Developer Boards for Force.com and Database.com
- :
- Apex Code Development
- :
- Re: Problem with Account object...
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Problem with Account object...
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-14-2012 12:42 AM
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?
Solved! Go to Solution.
Re: Problem with Account object...
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-14-2012 12:51 AM
please let me know which Salesforce.com API version are you using?
please change your version.
|
Action
|
Name
|
Version
|
Namespace
|
Type
|
|---|---|---|---|---|
| Salesforce.com API | Salesforce.com API |
Re: Problem with Account object...
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-14-2012 01:01 AM
Are you using this class as a Controller for any visualforce page? Check with that and let me know.
Kudos a post if it helps, mark it as solution if it solves.
http://exploretheforce.blogspot.in
Re: Problem with Account object...
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-14-2012 01:04 AM
Do you have a custom class named Account by any chance?
Certified Salesforce Technical Architect, Developer, Advanced Developer, Administrator, Advanced Administrator, Consultant, Sales Cloud Consultant,Service Cloud Consultant
Force.com MVP | The Bob Buzzard Blog | Linked In | Twitter
I don't respond to private messages/emails asking for help.
Take the Bob Buzzard Sobject Fields quiz.
Re: Problem with Account object...
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-14-2012 02:04 AM
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?
Re: Problem with Account object...
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-14-2012 02:10 AM
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?
Re: Problem with Account object...
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-14-2012 02:11 AM
Your class will override the standard sobject.
This is documented at:
http://www.salesforce.com/us/developer/docs/apexco
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.
Certified Salesforce Technical Architect, Developer, Advanced Developer, Administrator, Advanced Administrator, Consultant, Sales Cloud Consultant,Service Cloud Consultant
Force.com MVP | The Bob Buzzard Blog | Linked In | Twitter
I don't respond to private messages/emails asking for help.
Take the Bob Buzzard Sobject Fields quiz.

