-
Notifications
You must be signed in to change notification settings - Fork 0
Rules
Checks that the "Description" field is populated on custom objects.
Short Description
Custom objects should have a description.
Full Description
Custom objects should have a description describing the purpose of the object. Populate the 'Description' field on the custom object.
Metdata Types
- Custom Object
Example of incorrect metadata for this rule
<?xml version="1.0" encoding="UTF-8"?>
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
<deploymentStatus>Deployed</deploymentStatus>
<!-- Description is missing -->
<label>Car</label>
<nameField>
<encryptionScheme>None</encryptionScheme>
<label>Car Name</label>
<trackHistory>true</trackHistory>
<type>Text</type>
</nameField>
<pluralLabel>Cars</pluralLabel>
</CustomObject>
Example of correct metadata for this rule
<?xml version="1.0" encoding="UTF-8"?>
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
<deploymentStatus>Deployed</deploymentStatus>
<description>Car</description>
<label>Car</label>
<nameField>
<encryptionScheme>None</encryptionScheme>
<label>Car Name</label>
<trackHistory>true</trackHistory>
<type>Text</type>
</nameField>
<pluralLabel>Cars</pluralLabel>
</CustomObject>
Source: src/rules/no-missing-description-on-objects.ts
Checks that the "Description" field is populated on custom fields.
Short Description
Custom fields should have a description.
Full Description
Custom fields should have a description describing the purpose of the field. Populate the 'Description' field on the custom field.
Metdata Types
- Custom Field
Example of incorrect metadata for this rule
Example of correct metadata for this rule
Source: src/rules/no-missing-description-on-fields.ts
Checks that the "Description" field is populated on flows.
Short Description
Flows should have a description.
Full Description
Flows should have a description describing the purpose of the flow. Populate the 'Description' field on the flow.
Metdata Types
- Flow
Example of incorrect metadata for this rule
Example of correct metadata for this rule
Source: src/rules/no-missing-description-on-flows.ts
Checks that the "Description" field is populated on validation rules.
Short Description
Validation rules should have a description.
Full Description
Validation rules should have a description describing the purpose of the validation rule. Populate the 'Description' field on the validation rule.
Metdata Types
- Validation Rule
Example of incorrect metadata for this rule
Example of correct metadata for this rule
Source: src/rules/no-missing-description-on-validation-rules.ts
Checks that the "Description" field on custom objects meets a minimum length.
Short Description
Custom object descriptions should be at least {option.minimumLength} characters long.
Full Description
Custom object descriptions should be at least {option.minimumLength} characters long. Update the 'Description' field on the custom object.
Metdata Types
- Custom Object
Name | Description | Type | Example |
---|---|---|---|
minimumLength |
(optional, defaults to 50) The minimum length that the custom object description should meet. | integer | 30 |
Example of incorrect metadata for this rule
Example of correct metadata for this rule
Source: src/rules/description-min-length-on-objects.ts
Checks that the "Description" field on custom fields meets a minimum length.
Short Description
Custom field descriptions should be at least {option.minimumLength} characters long.
Full Description
Custom field descriptions should be at least {option.minimumLength} characters long. Update the 'Description' field on the custom field.
Metdata Types
- Custom Field
Name | Description | Type | Example |
---|---|---|---|
minimumLength |
(optional, defaults to 50) The minimum length that the custom field description should meet. | integer | 30 |
Example of incorrect metadata for this rule
Example of correct metadata for this rule
Source: src/rules/description-min-length-on-fields.ts
Checks that the "Description" field on flows meets a minimum length.
Short Description
Flow descriptions should be at least {option.minimumLength} characters long.
Full Description
Flow descriptions should be at least {option.minimumLength} characters long. Update the 'Description' field on the flow.
Metdata Types
- Flow
Name | Description | Type | Example |
---|---|---|---|
minimumLength |
(optional, defaults to 50) The minimum length that the flow description should meet. | integer | 30 |
Example of incorrect metadata for this rule
Example of correct metadata for this rule
Source: src/rules/description-min-length-on-flows.ts
Checks that the "Description" field on validation rules meets a minimum length.
Short Description
Validation rule descriptions should be at least {option.minimumLength} characters long.
Full Description
Validation rule descriptions should be at least {option.minimumLength} characters long. Update the 'Description' field on the Validation rule.
Metdata Types
- Validation Rule
Name | Description | Type | Example |
---|---|---|---|
minimumLength |
(optional, defaults to 50) The minimum length that the validation rule description should meet. | integer | 30 |
Example of incorrect metadata for this rule
Example of correct metadata for this rule
Source: src/rules/description-min-length-on-validation-rules.ts
Checks that the "Error Message" field on validation rules meets a minimum length.
Short Description
Validation rule error messages should be at least {option.minimumLength} characters long.
Full Description
Validation rule error messages should be at least {option.minimumLength} characters long, and describe how the user should resolve the validation error. Update the 'Error Message' field on the Validation rule.
Metdata Types
- Validation Rule
Name | Description | Type | Example |
---|---|---|---|
minimumLength |
(optional, defaults to 50) The minimum length that the validation rule description should meet. | integer | 30 |
Example of incorrect metadata for this rule
Example of correct metadata for this rule
Source: src/rules/error-message-min-length-on-validation-rules.ts
Some organisations want metadata prefixed with an identifier (eg. to distinguish work done by a partner from internal work).
Whilst this is often considered bad practice, this rule can be used to enforce it.
Short Description
Metadata API names should have a prefix.
Full Description
All metata must have an API name prefix of one of the following: {option.prefixes}. Update the API name to include the prefix.
or
Metadata of types: {option.types} should have one of the following prefixes: {option.prefixes}. Update the API name to include one the accepted prefixes.
Metdata Types
- All custom metadata or
- Types defined by the
option.types
rule option
Name | Description | Type | Example |
---|---|---|---|
prefixes |
(required) The prefixes you want the rule to check against | string (comma delimited) of prefixes | ACME_, EC_ |
types |
(optional) The types of metadata you want this rule to run against. If not specified, the rule will run against all custom metadata. | string (comma delimited) of metadata types, based on the file extension (case sensitive) - eg. For .flow-meta.xml use flow , for .validationRule-meta.xml use validationRule etc. |
field, fieldSet, listView |
exclude-namespaces |
(optional) The namespace of any custom metadata you wish to exclude from the rule | string (comma delimited) of namespaces | FinServ__, et4ae5__ |
Example of incorrect metadata for this rule
Example of correct metadata for this rule
Source: src/rules/no-missing-prefix-on-metadata.ts
For organisations who use prefixes for metadata, this rule can be used to prevent the prefix from being applied to certain metadata (alternatively you could selectively apply the no-missing-prefix-on-metadata
rule).
Alternatively this rule can be used in organisations that historically used prefixes, but now want to change the behaviour.
Short Description
Metadata API names should not have a prefix.
Full Description
Metadata API names should not be prefixed with any of the following: {option.prefixes}. Remove the prefix from the API name.
or
Metadata API names should not have a prefix of: {option.prefixes}. This applies to metadata of types: {option.types}. Remove the prefix from the API name.
Metdata Types
- All custom metadata or
- Types defined by the
option.types
rule option
Name | Description | Type | Example |
---|---|---|---|
prefixes |
(required) The prefixes you want the rule to check against | string (comma delimited) of prefixes | ACME_, EC_ |
types |
(optional) The types of metadata you want this rule to run against. If not specified, the rule will run against all custom metadata. | string (comma delimited) of metadata types, based on the file extension (case sensitive) - eg. For .flow-meta.xml use flow , for .validationRule-meta.xml use validationRule etc. |
field, fieldSet, listView |
exclude-namespaces |
(optional) The namespace of any custom metadata you wish to exclude from the rule | string (comma delimited) of namespaces | FinServ__, et4ae5__ |
Example of incorrect metadata for this rule
Example of correct metadata for this rule
Source: src/rules/no-prefix-on-metadata.ts
Whilst Salesforce automatically trims leading and trailing whitespace from picklist entries, it allows double spaces within the text. Additionally it hides the double space when viewing the picklist entry in the UI, unless you go to the edit page for it.
Double spaces are almost never intended, and often go unnoticed leading to unexpected behaviour within automations and integrations.
This rule checks for double spaces in either the label or value of the picklist entry.
Short Description
Picklist labels and values should not contain double spaces eg. 'Offer Made'.
Full Description
Picklist labels and values should not contain double spaces eg. 'Offer Made'. Remove the double space from the label and/or value.
Metdata Types
- Custom Field of type 'Picklist' or 'MultiselectPicklist'
Example of incorrect metadata for this rule
Example of correct metadata for this rule
Source: src/rules/no-double-spaces-in-picklist-fields.ts
Whilst Salesforce automatically trims leading and trailing whitespace from value set entries, it allows double spaces within the text. Additionally it hides the double space when viewing the value set entry in the UI, unless you go to the edit page for it.
Double spaces are almost never intended, and often go unnoticed leading to unexpected behaviour within automations and integrations.
This rule checks for double spaces in either the label or value of the value set entry.
Short Description
Value set labels and values should not contain double spaces eg. 'Offer Made'.
Full Description
Value set labels and values should not contain double spaces eg. 'Offer Made'. Remove the double space from the label and/or value.
Metdata Types
- Standard Value Set
- Global Value Set
Example of incorrect metadata for this rule
Example of correct metadata for this rule
- no-missing-description-on-objects
- no-missing-description-on-fields
- no-missing-description-on-flows
- no-missing-description-on-validation-rules
- description-min-length-on-objects
- description-min-length-on-fields
- description-min-length-on-flows
- description-min-length-on-validation-rules
- error-message-min-length-on-validation-rules
- no-missing-prefix-on-metadata
- no-prefix-on-metadata
- no-double-spaces-in-picklist-fields
- no-double-spaces-in-value-sets