You need to sign in to do that
Don't have an account?
Ab
best pactises to name the fields
Hello,
Are there any salesforce tools to manage the names of the resources or any general rules o follow to name the classes, VF, Lightning components, laysouts, etc
thank you for any inputs
Are there any salesforce tools to manage the names of the resources or any general rules o follow to name the classes, VF, Lightning components, laysouts, etc
thank you for any inputs
Greetings to you!
You can use the naming convention for your Apex Classes, Triggers, VF Pages, Components, etc i.e.; use some specific keyword when creating classes, pages, etc:
- Prefixing class names:
{prefix}_classname.clseg.: Page_AccountTable
Trgr_AccountDuplicate
- Suffixing class names:
classname_{suffix}.clseg.: AccountTable_page
AccountDuplicate_trgr
Apex classes are stored in the classes folder in the corresponding package directory. You cannot create a package in Salesforce to put your class. Salesforce put all the classes in a default folder. Apex classes doesn’t support nested namespaces or packages like Java to organize code in a clean way.
Please refer to below links for more information on naming convention in Salesforce.
https://github.com/cfpb/salesforce-docs/blob/master/_pages/Salesforce-Naming-Conventions.md
https://focusonforce.com/configuration/salesforce-naming-conventions-are-not-just-for-devs/
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_naming_conventions.htm
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas
All Answers
Greetings to you!
You can use the naming convention for your Apex Classes, Triggers, VF Pages, Components, etc i.e.; use some specific keyword when creating classes, pages, etc:
- Prefixing class names:
{prefix}_classname.clseg.: Page_AccountTable
Trgr_AccountDuplicate
- Suffixing class names:
classname_{suffix}.clseg.: AccountTable_page
AccountDuplicate_trgr
Apex classes are stored in the classes folder in the corresponding package directory. You cannot create a package in Salesforce to put your class. Salesforce put all the classes in a default folder. Apex classes doesn’t support nested namespaces or packages like Java to organize code in a clean way.
Please refer to below links for more information on naming convention in Salesforce.
https://github.com/cfpb/salesforce-docs/blob/master/_pages/Salesforce-Naming-Conventions.md
https://focusonforce.com/configuration/salesforce-naming-conventions-are-not-just-for-devs/
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_naming_conventions.htm
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas
Thank you for reply. Are there any tools that can be used for naming conventions ?
Ideally
Triggers:
- <ObjectName>Trigger - The trigger itself. One per object.
- <ObjectName>TriggerHandler - Class that handles all functionality of the trigger
- <ObjectName>TriggerTest
Controllers:- <ClassName>Controller
- <ClassName>ControllerExt
- <ClassName>ControllerTest
- <ClassName>ControllerExtTest
Classes:- <ClassName>
- <ClassName>Test (These might be Util classes or Service classes or something else).
Visualforce pages and components:<ControllerClassName>[optionalDescription] (without the suffix Controller). There might be multiple views so could also have an extra description suffix.
Object Names and custom Fields
Upper_Case_With_Underscores
Variables/properties/methods in Apex
camelCaseLikeJava - more easily differentiated from fields
Test methods in test classes
test<methodOrFunctionalityUnderTest><ShortTestCaseDesc> - For example, testSaveOpportunityRequiredFieldsMissing, testSaveOpportunityRequiredFieldsPresent, etc.
Refer this link
https://javarevisited.blogspot.com/2014/10/10-java-best-practices-to-name-variables-methods-classes-packages.html
https://howtodoinjava.com/java/basics/java-naming-conventions/
https://www.geeksforgeeks.org/java-naming-conventions/
http://codebuild.blogspot.com/2012/02/15-best-practices-of-variable-method.html
As of now, there are no tools for the naming convention in Salesforce.
Regards,
Khan Anas