{"id":1491,"date":"2015-12-29T10:57:21","date_gmt":"2015-12-29T10:57:21","guid":{"rendered":"http:\/\/www.greytrix.com\/blogs\/salesforce\/?p=1491"},"modified":"2025-06-20T06:14:32","modified_gmt":"2025-06-20T06:14:32","slug":"standard-controller-and-custom-class-name-conflict","status":"publish","type":"post","link":"https:\/\/www.greytrix.com\/blogs\/salesforce\/2015\/12\/29\/standard-controller-and-custom-class-name-conflict\/","title":{"rendered":"Standard Controller and Custom Class Name Conflict"},"content":{"rendered":"<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-content\/uploads\/2015\/12\/Illegal-Assignment.jpg\"><img decoding=\"async\" src=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-content\/uploads\/2015\/12\/Illegal-Assignment.jpg\" alt=\"Illegal Assignment\" class=\"wp-image-1494\"\/><\/a><\/figure><\/div>\n\n\n<p>While working for one of our clients, we came across an unusual error. And the error said:<\/p>\n\n\n\n<p><em>&#8211;&nbsp; <a href=\"https:\/\/www.greytrix.com\/product\/gumu\/salesforce-sage-erp-integration\" target=\"_blank\" rel=\"noopener\">Real-time, bi-directional, multi-company \u2013 Sage ERP Integration with Salesforce<\/a><\/em><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-content\/uploads\/2015\/12\/Code.png\"><img decoding=\"async\" src=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-content\/uploads\/2015\/12\/Code.png\" alt=\"Code\" class=\"wp-image-1495\"\/><\/a><\/figure><\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-content\/uploads\/2015\/12\/Class-with-same-name.png\"><img decoding=\"async\" src=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-content\/uploads\/2015\/12\/Class-with-same-name.png\" alt=\"Class with same name\" class=\"wp-image-1496\"\/><\/a><\/figure><\/div>\n\n\n<p>We had the same data type (at least as per us) on both sides of the assignment operator, a standard account record being assigned to a standard account variable. To us, we had not violated any of the assignment rules but were still encountering this strange error message. Our code looked somewhat like the following:<\/p>\n\n\n\n<p>Digging deeper, we realized that the Salesforce Org already had a custom class by the name \u201c<i><b>Account<\/b><\/i>\u201d and this was conflicting with the standard controller of \u201c<i><b>Account<\/b><\/i>\u201d provided by the platform. This was the cause of our error. Our custom class was confusing the compiler as to which class object to create and which one to refer. We renamed the custom class and the dependencies for the class; and our code started to work fine.<\/p>\n\n\n\n<p>As a matter of fact, the salesforce platform allows you to create the custom class with the same name as any standard controller, but when you try to use the standard controller it cannot differentiate between the two classes and hence throws the error. So to avoid any such issues, we strongly recommend that one should not name the custom controllers with any of the existing standard object API names.<\/p>\n\n\n\n<p><span style=\"font-size: Medium;\"><strong>About Us<\/strong><\/span><br><a href=\"https:\/\/www.greytrix.com\" target=\"_blank\" rel=\"noopener\">Greytrix<\/a> as a Salesforce Product development partner offers a wide variety of integration products and services to the end users as well as to the Partners across the globe. We offer Consultation, Configuration, Training and support services in out-of-the-box functionality as well as customizations to incorporate custom business rules and functionalities that require apex code incorporation into the Salesforce platform.<\/p>\n\n\n\n<p><a href=\"https:\/\/www.greytrix.com\" target=\"_blank\" rel=\"noopener\">Greytrix<\/a>&nbsp;has some unique solutions for Cloud CRM such as Salesforce integration with&nbsp;<a href=\"https:\/\/www.greytrix.com\/product\/sage-x3\/gumu-x3-salesforce-integration\" target=\"_blank\" rel=\"noopener\">Sage Enterprise Management (Sage X3)<\/a>,&nbsp;Sage Intacct, <a href=\"https:\/\/www.greytrix.com\/product\/sage-100-erp\/gumu-100-salesforce-integration\" target=\"_blank\" rel=\"noopener\">Sage 100<\/a> and&nbsp;<a href=\"https:\/\/www.greytrix.com\/product\/sage-300-erp\/gumu-300-salesforce-integration\" target=\"_blank\" rel=\"noopener\">Sage 300 (Sage Accpac)<\/a>. We also offer best-in-class Cloud CRM&nbsp;<a href=\"https:\/\/www.greytrix.com\/product\/crm-development\/salesforce-com\" target=\"_blank\" rel=\"noopener\">Salesforce customization and development services<\/a> along with services such as Salesforce <a href=\"https:\/\/www.greytrix.com\/product\/professional-services\/data-migration-services\" target=\"_blank\" rel=\"noopener\">Data Migration<\/a>, <a href=\"https:\/\/www.greytrix.com\/product\/professional-services\/integrated-application-development\" target=\"_blank\" rel=\"noopener\">Integrated App development<\/a>, <a href=\"https:\/\/www.greytrix.com\/product\/professional-services\/custom-development\" target=\"_blank\" rel=\"noopener\">Custom App development<\/a> and <a href=\"https:\/\/www.greytrix.com\/product\/professional-services\/maintenance-support\" target=\"_blank\" rel=\"noopener\">Technical Support<\/a> to business partners and end users.<\/p>\n\n\n\n<p>Greytrix GUMU&#x2122; integration for Sage ERP \u2013 Salesforce is a 5-star app listed on <a href=\"https:\/\/appexchange.salesforce.com\/listingDetail?listingId=a0N30000000psM5EAI\" target=\"_blank\" rel=\"noopener\">Salesforce AppExchange<\/a>.<\/p>\n\n\n\n<p>For more information, please contact us at <a href=\"mailto:salesforce@greytrix.com\">salesforce@greytrix.com<\/a>. We will be glad to assist you.<\/p>\n\n\n\n<p><strong><span style=\"font-size: Medium;\">Related Posts<\/span><\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"http:\/\/www.greytrix.com\/blogs\/salesforce\/2015\/12\/02\/salesforcea-mobile-app-for-administrators\/\" target=\"_blank\" rel=\"noopener\">SalesforceA &#8211; Mobile App for Administrators<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/www.greytrix.com\/blogs\/salesforce\/2015\/11\/29\/configure-debug-log-in-winter16\/\" target=\"_blank\" rel=\"noopener\">Configure Debug log in Winter&#8217;16<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/www.greytrix.com\/blogs\/salesforce\/2015\/11\/27\/map-your-business-process-in-salesforce\/\" target=\"_blank\" rel=\"noopener\">Map Your Business Process In Salesforce<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/www.greytrix.com\/blogs\/salesforce\/2015\/11\/27\/number-and-currency-field-shortcuts-in-salesforce\/\" target=\"_blank\" rel=\"noopener\">Number and Currency field shortcuts in Salesforce<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/www.greytrix.com\/blogs\/salesforce\/2015\/11\/23\/using-force-com-migration-tool-part-ii-deployment\/\" target=\"_blank\" rel=\"noopener\">Using Force.com Migration Tool Part II \u2013 Deployment<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>While working for one of our clients, we came across an unusual error. And the error said: &#8211;&nbsp; Real-time, bi-directional, multi-company \u2013 Sage ERP Integration with Salesforce We had the same data type (at least as per us) on both sides of the assignment operator, a standard account record being assigned to a standard account\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/2015\/12\/29\/standard-controller-and-custom-class-name-conflict\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[14,476],"class_list":["post-1491","post","type-post","status-publish","format-standard","hentry","category-salesforce-srv","tag-apex-classes","tag-standard-controller"],"_links":{"self":[{"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/posts\/1491","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/comments?post=1491"}],"version-history":[{"count":2,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/posts\/1491\/revisions"}],"predecessor-version":[{"id":10542,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/posts\/1491\/revisions\/10542"}],"wp:attachment":[{"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/media?parent=1491"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/categories?post=1491"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/tags?post=1491"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}