Skip to main content

Code reviews rule: Inconsistent naming custom object

Written by David Martin
Updated today

Inconsistent naming custom object

Why is this an issue?

Naming conventions help drive consistency across the application, making source code and metadata easier to read and understand. When custom objects don't follow established naming patterns, it becomes harder for developers and administrators to locate objects in lists and search results, understand the object's purpose at a glance and maintain consistency when creating related components

Examples

Example of incorrect naming:

<CustomObject>
<fullName>cust_order__c</fullName>
<label>Customer Order</label>
</CustomObject>

<CustomObject>
<fullName>INVOICE__c</fullName>
<label>Invoice</label>
</CustomObject>

Example of correct naming:

<CustomObject>
<fullName>Customer_Order__c</fullName>
<label>Customer Order</label>
</CustomObject>

<CustomObject>
<fullName>Invoice__c</fullName>
<label>Invoice</label>
</CustomObject>

How can I fix violations?

Update the name of the object to match your designated naming scheme.

When should I disable this rule?

You can configure the rule to match your organization's naming convention.

You may want to dismiss specific violations when this is a legacy object that is difficult to rename.

Resources

Did this answer your question?