Before starting any implementation, one should establish a good homogeneous naming pattern for every component. It helps identify components quickly without struggling with some hazardous naming. All should be written in English and translation workbench should be used to give the correct output to the end user.
Guidelines
First letter of each word is in uppercase and the following are in lowercase.
Avoid using special characters in API name.
Use “_” as the separator.
Batch
Component | Batch Scheduler |
Name | APSXXX_SchedulerName Ex: APS001_ExampleScheduler |
Component | Batch Job |
Name | APBXXX_BatchName Ex: APB001_ExampleBatch |
Scheduler and Batch should share the same increment number, if there are more than one scheduler per batch then you should add a suffix to the scheduler name.
Webservice
Component | Name |
Webservice Ressource | WSXXX_WebserviceName Ex: WS001_ExampleService |
Webservice Request | WRPXXX_WebserviceRequest Ex: WRP001_ExampleRequest |
Webservice Response | WRPXXX_WebserviceResponse Ex: WRP002_ExampleResponse |
VisualForce
Component | Name |
VisualForce Component | CXXX_ComponentName Ex: C001_Example |
VisulaForce Page | VFPXXX_PageName Ex: VFP001_Example |
VisualForce Controller | VFCXXX_ControllerName Ex: VFC001_Example |
VisualForce Wrapper | WRPXXX_WrapperName Ex: WRP001_Example |
Controller and Page should share the same increment number, if there are more than one page per controller then you should add a suffix to the page name.
A wrapper is an aggregation of information to display on the VisualForce page.
RecordType
Component | RecordType |
Label | Word1 Word2 Ex: Person Account |
Name | ObjectName_Word1Word2 Ex: Account_PersonAccount |
Description | Free Text Ex: RecordType to represents person account |
Page Layout
Component | Page Layout |
Name | ObjectName – Word1 Word2 Layout Ex: Account – B2C Layout |
Process
Component | Process |
Label | Word1 Word2 Ex: B2C Process |
Description | Free Text Ex: Process to describe B2C process |
Role
Component | Role |
Name | Branch/hierarchy – Word1 Word2 Ex: FR – Sales Rep |
Folder
Component | Folder |
Label | Word1 Word2 Ex: France – Portfolio Management |
Unique Name | Word1Word2 Ex: FrancePortfolioMgt |
Email Template
Component | Email Template |
Name | ObjectName – Word1 Word2 Ex: Account – Owner Notification |
Unique Name | ObjetcName_Word1Word2 Ex: AccountOwnerNotification |
Description | Free Text Ex: Notification sent to the owner of the account on each event |
Validation Rule
Component | Validation Rule |
Name | ObjectName_VRXXX_Word1Word2 Ex: Account_VR001_StreetIsMandatory |
Description | Free text Ex: The field Street must contain a value. |
Error Message | Free text Ex: Please fill the Street field. |
Custom Button / List view / Link
Component | Custom Button, List view or Link |
Label | Word1 Word2 Ex: Create New Offer |
Name | ObjectName_Word1Word2 Ex: Account_CreateNewOffer |
Home Page Component / Tab / App
Component | Name |
Home Page Component Label | Word1 Word2 Ex: Welcome Page |
Tab Description | Free Text Ex: Tab representing list of accounts |
App Label | Word1 Word2 Ex: Call Center |
AppName | Word1Word2 Ex; CallCenter |
App Description | Free Text Ex: Group of tabs to manage Call Center functionnalities |
Worflow Rules
Component | Workflow Rule |
Name | ObjectName_WFXXX_Word1Word2 Ex: Account_WF001_UpdateCity |
Description | Free text Ex: Update the field City on each update. |
Lightning Component
Component | Name |
CMP | LCXXX_ComponentName.cmp Ex: LC001_Example.cmp |
CSS | LCXXX_ComponentName.css Ex: LC001_Example.css |
SVG | LCXXX_ComponentName.svg Ex: LC001_Example.svg |
Controller JS | LCXXX_ComponentNameController.js Ex: LC001_ExampleController.js |
Helper JS | LCXXX_ComponentNameHelper.js Ex: LC001_ExampleHelper.js |
Renderer JS | LCXXX_ComponentNameRenderer.js Ex: LC001_ExampleRenderer.js |
App | LCAXXX_ApplicationName Ex: LCA001_ExampleApp |
Apex Controller | LCCXXX_ComponentNameController Ex: LCC001_ExampleController |
Process Builder
Component | Name |
Main Process Builder | ObjectName_PBXXX_Main Ex: Account_PB001_Main |
Invocable Sub Process Builder | ObjectName_PBXXX_Sub_XXX Ex: Account_PB001_Sub_003 |
Flow
Component | Name |
Object Flow | ObjectName_FLOW_XXX_ProcessName Ex: Account_FLOW_001_CreateChildStore |
Process Flow | ProcessName_FLOW_XXX Ex: OrderQuickProcess_FLOW_002 |
Custom Object
Component | Custom Object |
Label | Word1 Word2 Ex: Account Criteria |
Name | Word1Word2__c Ex: AccountCriteria__c |
Description | Free Text Ex: Criterias to apply for each account |
Child Relationship name | ObjectName(s) Ex: Contacts |
Custom Fields
Component | Custom Field |
Label | Word1 Word2 Ex: Total Amount |
Name | Word1Word2__c Ex: TotalAmount__c |
Description | Free Text Ex: Amount calculated by external system |
Technical Field Name & Label | TECH_Word1Word2 |
Technical fields should never be displayed on layout.
Apex Class
Component | Name |
Service Manager | SMXXX_ServiceName Ex: SM001_BillingProcess |
Entity Manager | EMXXX_EntityName Ex: EM001_Account |
Data Manager | DMXXX_EntityName Ex: DM001_Account |
Trigger Manager | APTXXX_EntityName Ex: APT001_AccountTrigger |
Trigger | EntityNameTrigger Ex: AccountTrigger |
Utility Class | APUXXX_UtilityName Ex: APU001_StringUtils |
Test Class | ClassNameToTest_TEST Ex: EM001_Account_TEST |
Dependent Mock Class | MCK_ClassNameToMock Ex: MCK_DM001_Account |
Independent Mock Class | MCKXXX_MockName Ex: MCK001_BillingService |
Dependent Interface | ITF_ClassNameToInterface Ex: ITF_DM001_Account |
Independent Interface | ITFXXX_InterfaceName Ex: ITF001_GlobalAccount |
Wrapper | WRPXXX_WrapperName Ex: WRP001_Request |
Test Factory | TestDataFactory |
Exception | EXCXXX_ExceptionName Ex: EXC001_CalloutException |
Cache Builder or Custom Cache handler | APCXXX_CacheBuilderName Ex: APC001_UserInfoCache |
Process Invocable Controller | PICXXX_ControllerName Ex: PIC001_ExampleController |
Conclusion
It was a long read if you reach this point, not the most exciting topic but it’s the basis. I haven’t covered every component but you have the idea and should be able to deal perfectly with the remaining ones. Remember that it’s important to settle naming pattern, not necessarily mine, but it has to be consistent and easy to remember and apply.
Hope you enjoy reading this article, see you soon for the next one ...