Skip to content

Salesforce deployment assistant errors list

sfdx-hardis can help solve solve deployment errors using a predefined list of issues and associated solutions

See how to setup Deployment Agent

If you see a deployment error which is not here yet, please add it in this file :)

API Version error

Detection

  • RegExp: Error (.*) The (.*) apiVersion can't be "([0-9]+)"

Examples

  • Error Account_Record_Page The FlexiPage apiVersion can't be "66"

Resolution

{1} was saved in an org that already runs the next Salesforce release (API version {3}), that the target org does not know yet.
- Lower <apiVersion>{3}.0</apiVersion> in the file of {1} to the API version of the target org
- Keep sourceApiVersion of sfdx-project.json at the version of the production org: sfdx-hardis deploys with the lowest of this version and the one of the target org
- The built-in replacement rules remove the XML elements a target org does not know yet: if one is missing, see https://sfdx-hardis.cloudity.com/salesforce-devops-config-replacement-rules-builtin/

Allow deployment with pending Apex Jobs

Detection

  • String: You can bypass this error by allowing deployments with Apex jobs in the Deployment Settings page in Setup.

Examples

  • Error AccountBatch This Apex class has batch or future jobs pending or in progress. You can bypass this error by allowing deployments with Apex jobs in the Deployment Settings page in Setup.

Resolution

Apex jobs (batch, queueable, scheduled) of the target org use classes of the deployment.
- Allow it in the target org: Setup -> Deployment Settings -> "Allow deployments of components when corresponding Apex jobs are pending or in progress"
- The manual deployment action below reminds to do it in each org of the pipeline, with a checkbox in the Pull Request comments

Deployment action

A deployment action can solve this error. Create it on the Pull Request of the current branch:

sf hardis:project:action:create --agent --scope pr --pr-id current --when pre-deploy --type manual --label "Allow deployments with pending Apex jobs" --instructions "1. Open Setup, type Deployment Settings in the Quick Find box, and open Deployment Settings
2. Check \"Allow deployments of components when corresponding Apex jobs are pending or in progress\", then Save
3. If it is already checked, there is nothing to do"

Documentation: https://sfdx-hardis.cloudity.com/salesforce-devops-work-on-user-story-deployment-actions-manual/


Agent running user has no access to the agent

Detection

  • RegExp: Error (.*) User doesn't have access to agent

Examples

  • Error Customer_Agent User doesn't have access to agent

Resolution

The running user of agent {1} (botUser in its AiAgentDefinition) exists in the target org, but cannot run agents
- Assign it the permission sets AgentforceServiceAgentBase, AgentforceServiceAgentUser and EinsteinGPTPromptTemplateUser, with the profile Einstein Agent User
- Or let sfdx-hardis create a user with sf org create agent-user: keep the built-in replacement rule builtin-agent-running-user on, and remove the replacement rule of your own that writes botUser. See https://sfdx-hardis.cloudity.com/salesforce-ci-cd-agentforce-agents/#the-running-user-of-a-service-agent

Can not change field type to a formula field

Detection

  • RegExp: Error (.*) Cannot update a field from a Formula to something else

Examples

  • Error Account.Score__c Cannot update a field from a Formula to something else

Resolution

Salesforce can not turn formula field {1} into another type with a deployment.
- Before the deployment, rename {1} into {1}_ToDel in the target org (or delete it), so the deployment creates {1} with its new type
- Once the deployment is done, delete {1}_ToDel
- The manual deployment action below reminds to do it in each org of the pipeline, with a checkbox in the Pull Request comments

Deployment action

A deployment action can solve this error. Create it on the Pull Request of the current branch:

sf hardis:project:action:create --agent --scope pr --pr-id current --when pre-deploy --type manual --label "Rename formula field {1} before its type changes" --instructions "1. In Setup, open Object Manager, the object of {1}, then Fields & Relationships
2. Open {1}, click Edit, add _ToDel at the end of its Field Name, and Save
3. After the deployment, delete the _ToDel field
4. If {1} already has its new type, there is nothing to do"

Documentation: https://sfdx-hardis.cloudity.com/salesforce-devops-work-on-user-story-deployment-actions-manual/


Can not change type due to existing data

Detection

  • RegExp: Error (.*) Cannot change type due to existing data

Examples

  • Error Account.Status__c Cannot change type due to existing data

Resolution

Records of the target org hold values that the new type of {1} can not keep. Changing the type of a field is usually not recommended. If it is really needed:
- Change the type of {1} manually in the target org before the deployment, if Setup allows it
- If Setup refuses it, update or remove what uses {1} (formulas, Flows...), and deploy them again later
- The manual deployment action below reminds to do it in each org of the pipeline, with a checkbox in the Pull Request comments
- More help: https://help.salesforce.com/s/articleView?id=000327186&type=1

Deployment action

A deployment action can solve this error. Create it on the Pull Request of the current branch:

sf hardis:project:action:create --agent --scope pr --pr-id current --when pre-deploy --type manual --label "Change the type of field {1}" --instructions "1. In Setup, open Object Manager, the object of {1}, then Fields & Relationships
2. Open {1}, click Change Field Type, and select the type it has in the sources
3. If {1} already has this type, there is nothing to do"

Documentation: https://sfdx-hardis.cloudity.com/salesforce-devops-work-on-user-story-deployment-actions-manual/


Can not change field type with picklist

Detection

  • RegExp: Error (.*) Cannot change which global value set this picklist uses

Examples

  • Error Account.Region__c Cannot change which global value set this picklist uses

Resolution

You probably updated the global value set of picklist {1}, and Salesforce does not allow that with deployments. You can:
- Change it manually in the target org before the deployment, if Setup allows it
- Or delete field {1} in the target org (its data is lost: be careful in production), so the deployment creates it again
- Or create another field with the new value set, and move the data with a data deployment action (https://sfdx-hardis.cloudity.com/salesforce-devops-work-on-user-story-deployment-actions-data/)
- The manual deployment action below reminds to do it in each org of the pipeline, with a checkbox in the Pull Request comments

Deployment action

A deployment action can solve this error. Create it on the Pull Request of the current branch:

sf hardis:project:action:create --agent --scope pr --pr-id current --when pre-deploy --type manual --label "Change the value set of picklist {1}" --instructions "1. In Setup, open Object Manager, the object of {1}, then Fields & Relationships
2. Open {1} and set the value set it has in the sources, or delete the field if its data can be lost
3. If {1} already uses this value set, there is nothing to do"

Documentation: https://sfdx-hardis.cloudity.com/salesforce-devops-work-on-user-story-deployment-actions-manual/


Can not delete custom field

Detection

  • RegExp: Error (.*?) This .* is referenced elsewhere in salesforce.com
  • RegExp: Le champ personnalisé (.*) est utilisé dans (.*)

Examples

  • Error Account.Old_Field__c This custom field is referenced elsewhere in salesforce.com. : Apex Class - AccountService

Resolution

Custom field {1} can not be deleted while other items use it.
- Remove its references from your sources: sf hardis:project:clean:references --config manifest/destructiveChanges.xml removes every reference to the items listed there
- Items of the target org that are not in git (reports, list views...) must be updated in the org
THIS MAY BE A FALSE POSITIVE if you are only testing the deployment: destructive changes are checked separately from the rest of the deployment

Flow Interviews block Flow deletion

Detection

Examples

  • Error My_Flow This flow version is referenced elsewhere in salesforce.com. : Flow Interview - 0FoAa000000AbCdEFG

Resolution

A Flow version can not be deleted because Flow Interviews are still running on it.
- To let sfdx-hardis delete these Flow Interviews before deleting the Flow, set FLOW_DELETE_INTERVIEWS=true (or add FLOW_DELETE_INTERVIEWS on its own line in your Pull Request description, or set flowDeleteInterviews: true in .sfdx-hardis.yml)
- Caution: deleting Flow Interviews is irreversible and destroys in-flight process state

Can not delete record type

Detection

  • RegExp: Error (.*) Cannot delete record type through API

Examples

  • Error Account.Old_Type Cannot delete record type through API

Resolution

Record types can not be deleted by a deployment.
- The deployment action below deactivates and deletes record type {1} in the target org before the deployment
- Or do it manually in the target org: edit record type {1}, uncheck "Active", then delete it

Deployment action

A deployment action can solve this error. Create it on the Pull Request of the current branch:

sf hardis:project:action:create --agent --scope pr --pr-id current --when pre-deploy --type browser --label "Delete record type {1}" --browser-setting recordTypes --browser-config '{"deletions":[{"fullName":"{1}"}]}'

A deployment check only simulates a browser action. If this check still fails on this error once the action is created, apply the setting once in the target org with the Run in another org button of the VS Code Deployment Actions tab, or with sf hardis:project:action:run --select-org, then run the check again.

Documentation: https://amtrack.github.io/sfdx-browserforce-plugin/settings/recordTypes/


Can not find folder

Detection

  • RegExp: Error (.*) Cannot find folder:(.*)

Examples

  • Error Sales/Pipeline_Report Cannot find folder:Sales

Resolution

Folder {2} is missing.
- If folder {2} is in your sources, check that it is in manifest/package.xml: saving your User Story adds it
- If folder {2} is not in your sources, run sf hardis:project:clean:retrievefolders to retrieve the folders of reports, dashboards, documents and email templates
- If both did not work, create folder {2} manually in the target org

Can not find user

Detection

  • RegExp: Error (.*) Cannot find a user that matches any of the following usernames

Examples

  • Error Shared_Reports Cannot find a user that matches any of the following usernames: john.doe@acme.com.dev; remove the user from the component and try deploying again.

Resolution

{1} names users that do not exist in the target org: usernames are not the same in each org (sandbox suffix).
- Share with public groups or roles instead of named users -> https://help.salesforce.com/s/articleView?id=sf.creating_and_editing_groups.htm&type=5
- Or add a text replacement rule that writes the username of each org before each deployment (https://sfdx-hardis.cloudity.com/salesforce-devops-config-replacement-rules/)
- Or remove the XML part referring to the usernames

Example of XML you have to remove in {1}:

<folderShares>
  <accessLevel>Manage</accessLevel>
  <sharedTo>nicolas.vuillamy@hardis-scratch-po-tgci-root-develop_20220412_0604.com</sharedTo>
  <sharedToType>User</sharedToType>
</folderShares>

Can not find user (2)

Detection

  • RegExp: Error (.*) In field: (.*) - no User named (.*) found

Examples

  • Error Case_Assignment In field: assignedTo - no User named john.doe@acme.com.dev found

Resolution

{1} names user {3}, which does not exist in the target org: usernames are not the same in each org (sandbox suffix).
- Assign to public groups or queues instead of named users -> https://help.salesforce.com/s/articleView?id=sf.creating_and_editing_groups.htm&type=5
- Or add a text replacement rule that writes the username of each org before each deployment (https://sfdx-hardis.cloudity.com/salesforce-devops-config-replacement-rules/)
- Or create user {3} in the target org

Cannot update a field to a Summary from something else

Detection

  • RegExp: Error (.*) Cannot update a field to a (.*) from something else

Examples

  • Error Account.Total__c Cannot update a field to a Summary from something else

Resolution

You probably changed the type of field {1} to {2}, and Salesforce does not allow that with deployments. You can:
- Change the type of {1} manually in the target org before the deployment, if Setup allows it
- Or delete field {1} in the target org (its data is lost: be careful in production), so the deployment creates it again
- Or create another field with the new type, and move the data with a data deployment action (https://sfdx-hardis.cloudity.com/salesforce-devops-work-on-user-story-deployment-actions-data/)
- The manual deployment action below reminds to do it in each org of the pipeline, with a checkbox in the Pull Request comments

Deployment action

A deployment action can solve this error. Create it on the Pull Request of the current branch:

sf hardis:project:action:create --agent --scope pr --pr-id current --when pre-deploy --type manual --label "Change the type of field {1} to {2}" --instructions "1. In Setup, open Object Manager, the object of {1}, then Fields & Relationships
2. Open {1}, click Change Field Type and select {2}, or delete the field if its data can be lost
3. If {1} is already a {2}, there is nothing to do"

Documentation: https://sfdx-hardis.cloudity.com/salesforce-devops-work-on-user-story-deployment-actions-manual/


Change Matching Rule

Detection

  • RegExp: Error (.*) Before you change a matching rule, you must deactivate it

Examples

  • Error Account.Standard_Account_Match_Rule Before you change a matching rule, you must deactivate it

Resolution

Salesforce refuses to change matching rule {1} while it is active.
- Deactivate {1} in the target org before the deployment: the deployment activates it again if its file says so
- The manual deployment action below reminds to do it in each org of the pipeline, with a checkbox in the Pull Request comments

Deployment action

A deployment action can solve this error. Create it on the Pull Request of the current branch:

sf hardis:project:action:create --agent --scope pr --pr-id current --when pre-deploy --type manual --label "Deactivate matching rule {1}" --instructions "1. Open Setup, type Matching Rules in the Quick Find box, and open Matching Rules
2. Click Deactivate next to {1}, and wait until its status is Inactive
3. If it is already inactive, there is nothing to do"

Documentation: https://sfdx-hardis.cloudity.com/salesforce-devops-work-on-user-story-deployment-actions-manual/


Condition missing reference

Detection

  • RegExp: Error (.*) field integrity exception: unknown \(A condition has a reference to (.*), which doesn't exist.\)

Examples

  • Error Account_Flow field integrity exception: unknown (A condition has a reference to Account.Old__c, which doesn't exist.)

Resolution

{1} refers to {2}, which is not in the target org. You can either:
- Deploy {2}: retrieve it from your org with the Metadata Retriever of VS Code, commit it and save your User Story: sfdx-hardis adds it to manifest/package.xml
- With delta deployments, an item that did not change in the Pull Request is not deployed: change it in the Pull Request, or turn on useDeltaDeploymentWithDependencies (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)
- Remove the reference to {2} from {1}

Couldn't retrieve or load information on the field

Detection

  • RegExp: Error (.*) Something went wrong. We couldn't retrieve or load the information on the field: (.*)\.

Examples

  • Error Account_Record_Page Something went wrong. We couldn't retrieve or load the information on the field: Account.Old__c.

Resolution

{1} refers to field {2}, which is not in the target org. You can either:
- Deploy {2}: retrieve it from your org with the Metadata Retriever of VS Code, commit it and save your User Story: sfdx-hardis adds it to manifest/package.xml
- With delta deployments, an item that did not change in the Pull Request is not deployed: change it in the Pull Request, or turn on useDeltaDeploymentWithDependencies (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)
- Remove the reference to {2} from {1}

Custom object not found

Detection

  • RegExp: Error (.*) In field: field - no CustomObject named (.*) found

Examples

  • Error Admin In field: field - no CustomObject named Invoice__c found

Resolution

{1} refers to custom object {2}, which is not in the target org.
- If you renamed {2}, search and replace its old name in your sources
- If you deleted {2}, or do not want to deploy it: list the items in a destructiveChanges.xml file, then sf hardis:project:clean:references --config <that file> removes every reference to them from your sources
- If {2} must exist: retrieve it from your org with the Metadata Retriever of VS Code, commit it and save your User Story: sfdx-hardis adds it to manifest/package.xml
- With delta deployments, an item that did not change in the Pull Request is not deployed: change it in the Pull Request, or turn on useDeltaDeploymentWithDependencies (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)

Custom field not found

Detection

  • RegExp: Error (.*) In field: (.*) - no CustomField named (.*)\.(.*) found

Examples

  • Error PS_Admin In field: field - no CustomField named User.expcloud__Portal_Username__c found

Resolution

{1} refers to field {3}.{4}, which is not in the target org.
- If you renamed {3}.{4}, search and replace its old name in {1}
- If you deleted {3}.{4}, or do not want to deploy it: list the items in a destructiveChanges.xml file, then sf hardis:project:clean:references --config <that file> removes every reference to them from your sources
- If {3}.{4} must exist: retrieve it from your org with the Metadata Retriever of VS Code, commit it and save your User Story: sfdx-hardis adds it to manifest/package.xml
- With delta deployments, an item that did not change in the Pull Request is not deployed: change it in the Pull Request, or turn on useDeltaDeploymentWithDependencies (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)
- If {3}.{4} is a standard field, the target org lacks its feature or license: enable it there, or remove the reference from {1}. The autoCleanTypes of .sfdx-hardis.yml (localfields, datadotcom, caseentitlement, productrequest) remove the usual ones at each save (https://sfdx-hardis.cloudity.com/salesforce-devops-config-cleaning/)

Mandatory custom field can not be in a profile/permission set

Detection

  • RegExp: Error (.*) You cannot deploy to a required field: (.*)

Examples

  • Error Admin You cannot deploy to a required field: Account.Code__c

Resolution

{1} sets the access of the required field {2}: a required field is always readable and editable, so its access can not be deployed.
- Remove the <fieldPermissions> block of {2} from {1}
- If {2} is required in the target org only, add a replacement rule that removes it before each deployment to the orgs that refuse it (https://sfdx-hardis.cloudity.com/salesforce-devops-config-replacement-rules/):
  sf hardis:project:replacement:create --agent --layer project --id remove-required-field-access --type xml-remove --files "**/profiles/*.profile-meta.xml" --xml-path "Profile/fieldPermissions[field={2}]" --include-branches TARGET_BRANCH

Example of element to delete:
<fieldPermissions>
  <editable>true</editable>
  <field>{2}</field>
  <readable>true</readable>
</fieldPermissions>

Custom metadata entry not found

Detection

  • RegExp: Error (.*) In field: (.*) - no CustomMetadata named (.*) found

Examples

  • Error Account_Rules In field: field - no CustomMetadata named Setting__mdt.Default found

Resolution

{1} refers to custom metadata record {3} of type {2}, which is not in the target org.
- Deploy the record {3}: retrieve it from your org with the Metadata Retriever of VS Code, commit it and save your User Story: sfdx-hardis adds it to manifest/package.xml
- With delta deployments, an item that did not change in the Pull Request is not deployed: change it in the Pull Request, or turn on useDeltaDeploymentWithDependencies (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)

Expired Access / Refresh Token

Detection

  • String: expired access/refresh token
  • Applies to: component errors, deployment errors

Examples

  • Error authenticating with the refresh token due to: expired access/refresh token

Resolution

The authentication to the org expired.
- Locally, run "Select another org" from the Status panel of VS Code (or sf hardis:org:select) to authenticate again
- In CI/CD, configure the authentication of the branch again with sf hardis:project:configure:auth

Missing Data Category Group

Detection

  • RegExp: Error (.*) In field: DeveloperName - no DataCategoryGroup named (.*) found

Examples

  • Error Knowledge_Settings In field: DeveloperName - no DataCategoryGroup named Products found

Resolution

{1} uses data category group {2}, which is not in the target org.
- Deploy the DataCategoryGroup {2}: retrieve it from your org with the Metadata Retriever of VS Code, commit it and save your User Story: sfdx-hardis adds it to manifest/package.xml
- With delta deployments, an item that did not change in the Pull Request is not deployed: change it in the Pull Request, or turn on useDeltaDeploymentWithDependencies (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)
- Or remove the reference to {2} from {1}

Dependent class is invalid and needs recompilation

Detection

  • RegExp: Error (.*) Dependent class is invalid and needs recompilation

Examples

  • Error AccountService Dependent class is invalid and needs recompilation: Class AccountHelper : Invalid type: Foo

Resolution

Solve the other errors and this one will disappear !

Duplicate value Platform Action Id List

Detection

  • String: duplicate value found: PlatformActionListId duplicates value on record with id

Examples

  • Error Account-Account Layout duplicate value found: PlatformActionListId duplicates value on record with id: 0JIAa000000AbCd

Resolution

There are probably issue with conflict management. Open the XML of the source item, and replace all <sortOrder> numbers to make an ascending order, starting with 0

Duplicate label

Detection

  • RegExp: Error (.*) Duplicate label: (.*)

Examples

  • Error Account.Status__c Duplicate label: Closed

Resolution

You probably renamed the API name of the picklist value with label {2} in {1}: the target org still has the value with its old API name, and the same label.
- A deployment action can rename the value in the target org before the deployment: replace OLD_API_NAME with its API name in the target org (Setup, the values of {1})
- Or rename it manually in the target org, then deploy again

Deployment action

A deployment action can solve this error. Create it on the Pull Request of the current branch:

sf hardis:project:action:create --agent --scope pr --pr-id current --when pre-deploy --type browser --label "Rename picklist value {2} of {1}" --browser-setting picklists --browser-config '{"picklistValues":[{"metadataType":"METADATA_TYPE","metadataFullName":"{1}","value":"OLD_API_NAME","newApiName":"NEW_API_NAME"}]}'

Before running it, replace OLD_API_NAME, NEW_API_NAME, METADATA_TYPE in the command with the real value.

A deployment check only simulates a browser action. If this check still fails on this error once the action is created, apply the setting once in the target org with the Run in another org button of the VS Code Deployment Actions tab, or with sf hardis:project:action:run --select-org, then run the check again.

Documentation: https://amtrack.github.io/sfdx-browserforce-plugin/settings/picklists/


Missing e-mail template

Detection

  • RegExp: In field: template - no EmailTemplate named (.*) found

Examples

  • Error Case_Alert In field: template - no EmailTemplate named Support/Case_Created found

Resolution

Email template {1} is not in the target org.
- Deploy it: retrieve it from your org with the Metadata Retriever of VS Code, commit it and save your User Story: sfdx-hardis adds it to manifest/package.xml
- If its folder is missing too, run sf hardis:project:clean:retrievefolders
- With delta deployments, an item that did not change in the Pull Request is not deployed: change it in the Pull Request, or turn on useDeltaDeploymentWithDependencies (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)

Empty custom object

Detection

  • RegExp: Error (.*) Must specify a non-empty label for the CustomObject

Examples

  • Error Invoice__c Must specify a non-empty label for the CustomObject

Resolution

The CustomObject {1} has been committed without its attributes: its .object-meta.xml has no label, so the target org can not create it.
This usually happens when an object is retrieved empty, for example an object owned by a managed package.
- Retrieve {1} again with the Metadata Retriever of VS Code, and check that its .object-meta.xml has a label and the other attributes of the object
- If {1} belongs to a managed package, remove it from your sources: sf hardis:project:clean:manageditems --namespace <namespace>
- Or, if {1} does not belong to your project, remove the objects/{1} folder: saving your User Story updates manifest/package.xml

Empty source items

Detection

  • String: Required field is missing: sharingOwnerRules
  • String: Required field is missing: standardValue
  • String: Required field is missing: valueTranslation

Examples

  • Error Account Required field is missing: sharingOwnerRules

Resolution

You probably retrieved empty items, that must not be in the SFDX project.
- Remove them with sf hardis:project:clean:emptyitems
- Add emptyItems to autoCleanTypes in .sfdx-hardis.yml, so sfdx-hardis removes them each time a User Story is saved (https://sfdx-hardis.cloudity.com/salesforce-devops-config-cleaning/)

Enable CRM Analytics

Detection

  • String: It should be created by enabling the CRM Analytics Cloud preference

Examples

  • Error Sales_Analytics The Analytics Cloud Integration User does not exist. It should be created by enabling the CRM Analytics Cloud preference

Resolution

CRM Analytics (formerly Wave, Einstein Analytics, Tableau CRM) is not enabled in the target org.
- Enable it in the target org (Setup -> Analytics -> Getting Started), and assign the CRM Analytics Admin permission set to the deployment user
- The manual deployment action below reminds to do it in each org of the pipeline, with a checkbox in the Pull Request comments

Deployment action

A deployment action can solve this error. Create it on the Pull Request of the current branch:

sf hardis:project:action:create --agent --scope pr --pr-id current --when pre-deploy --type manual --label "Enable CRM Analytics" --instructions "1. Open Setup, type Getting Started in the Quick Find box under Analytics, and click Enable CRM Analytics
2. Assign the permission set CRM Analytics Admin (or CRM Analytics Plus Admin) to the user of the CI/CD deployments
3. If CRM Analytics is already enabled, there is nothing to do"

Documentation: https://sfdx-hardis.cloudity.com/salesforce-devops-work-on-user-story-deployment-actions-manual/


Error parsing file

Detection

  • RegExp: Error (.*) Error parsing file: (.*)

Examples

  • Error Account.Status__c Error parsing file: Element {http://soap.sforce.com/2006/04/metadata}valueSet invalid at this location

Resolution

The XML file of {1} is not valid: {2}
- Open the file of {1} and look for the error: merge conflict markers, typo, XML tag not closed...
- If the element is valid for a newer API version only, the built-in replacement rules remove the known ones for older orgs (https://sfdx-hardis.cloudity.com/salesforce-devops-config-replacement-rules-builtin/)

Read only layout field must not be Required

Detection

  • RegExp: Field:(.*) must not be Required

Examples

  • Error Account-Account Layout Field:Code__c must not be Required

Resolution

You probably made read only field {1} that was required before.
Find field {1} in the layout source XML, then replace Required by Readonly

Field not available for element

Detection

  • RegExp: Field (.*) is not available for

Examples

  • Error Account-Account Layout Field Code__c is not available for this element

Resolution

You probably changed the type of field {1}.
Find field {1} in the source XML, and remove the section using it

Formula picklist field issue

Detection

  • String: Picklist fields are only supported in certain functions.
  • String: Les champs de liste de sélection sont pris en charge uniquement dans certaines fonctions.

Examples

  • Error Account.Is_Hot__c Picklist fields are only supported in certain functions.

Resolution

You probably changed the type of a field that is used in a formula.
Update the formula to use a field compliant with formulas.
More details at https://help.salesforce.com/articleView?id=sf.tips_on_building_formulas.htm&type=5

Flow must be deleted manually

Detection

Examples

  • Error force-app/main/default/flows/My_Flow.flow My_Flow insufficient access rights on cross-reference id

Resolution

Flow {1} can not be deleted by a metadata deployment: every version must be inactive and named one by one.
- Delete it with sfdx-hardis: list Flow {1} in manifest/destructiveChanges.xml (or preDestructiveChanges.xml), and sf hardis:project:deploy:smart deletes all its versions through the Tooling API
- If Flow Interviews still run on it, see https://sfdx-hardis.cloudity.com/hardis/project/deploy/smart/
- Or delete it manually in the target org: Setup -> Flows, context menu on {1} -> View details and versions -> Deactivate all versions -> Delete flow

Insufficient access rights on cross-reference id

Detection

  • RegExp: Error (.*) insufficient access rights on cross-reference id

Examples

  • Error My_Flow insufficient access rights on cross-reference id

Resolution

{1} refers to an item the deployment user can not access, or can not change with a deployment.
- If {1} is a Flow to delete, list it in manifest/destructiveChanges.xml: sf hardis:project:deploy:smart deletes all its versions through the Tooling API
- If you changed a custom field from unique to not unique, make the change manually in the target org
- Check that the user of the CI/CD deployments can see the records and items {1} refers to

Invalid formula grouping context

Detection

  • RegExp: Error (.*) Invalid custom summary formula definition: You must select a grouping context

Examples

  • Error Pipeline_Report Invalid custom summary formula definition: You must select a grouping context to use any report summary function.

Resolution

A summary formula of report {1} uses a summary function (PREVGROUPVAL, PARENTGROUPVAL...) without its grouping context.
- Update the report definition, see -> https://salesforce.stackexchange.com/questions/294850/grouping-error-with-prevgroupval-function
- If business users maintain this report in the org, list it in manifest/package-no-overwrite.xml, so CI/CD deploys it only once (https://sfdx-hardis.cloudity.com/salesforce-devops-config-overwrite/)

Invalid report type

Detection

  • RegExp: Error (.*) invalid report type

Examples

  • Error Sales/Pipeline_Report invalid report type

Resolution

The report type of report {1} is not in the target org.
- Open report {1} to see what report type it uses
- Deploy the report type: retrieve it from your org with the Metadata Retriever of VS Code, commit it and save your User Story: sfdx-hardis adds it to manifest/package.xml
- With delta deployments, an item that did not change in the Pull Request is not deployed: change it in the Pull Request, or turn on useDeltaDeploymentWithDependencies (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)
- If business users maintain this report in the org, list it in manifest/package-no-overwrite.xml (https://sfdx-hardis.cloudity.com/salesforce-devops-config-overwrite/)

Invalid scope:Mine, not allowed

Detection

  • String: Invalid scope:Mine, not allowed

Examples

  • Error Account.My_Accounts Invalid scope:Mine, not allowed

Resolution

List views with scope Mine can not be deployed: replace Mine by Everything in the list view XML.
- sf hardis:project:clean:listviews does it for all list views (https://sfdx-hardis.cloudity.com/hardis/project/clean/listviews/)
- Add listViewsMine to autoCleanTypes in .sfdx-hardis.yml, so sfdx-hardis does it each time a User Story is saved, and sf hardis:org:fix:listviewmine sets Mine back in the org after the deployment (https://sfdx-hardis.cloudity.com/hardis/org/fix/listviewmine/)

Detection

  • RegExp: Error (.*) Invalid field:(.*) in related list:(.*)

Examples

  • Error Account-Account Layout Invalid field:SOLUTION.ISSUE in related list:RelatedSolutionList

Resolution

Field {2} of related list {3} is unknown in the target org. You can:
- Enable the feature or license that brings {2} in the target org
- Remove field {2}, or the whole related list {3}, from {1}
- If {2} exists in some orgs only, add a replacement rule that removes it before each deployment to the orgs that refuse it (https://sfdx-hardis.cloudity.com/salesforce-devops-config-replacement-rules/):
  sf hardis:project:replacement:create --agent --layer project --id remove-unknown-related-list --type xml-remove --files "**/layouts/*.layout-meta.xml" --xml-path "Layout/relatedLists[relatedList={3}]" --include-branches TARGET_BRANCH
Example of XML to remove:
<relatedLists>
  <fields>SOLUTION.ISSUE</fields>
  <fields>SOLUTION.SOLUTION_NUMBER</fields>
  <fields>SOLUTION.STATUS</fields>
  <fields>CORE.USERS.ALIAS</fields>
  <relatedList>RelatedSolutionList</relatedList>
</relatedLists>

Invalid field for upsert

Detection

  • RegExp: Error (.*) Invalid field for upsert, must be an External Id custom or standard indexed field: (.*) \((.*)\)

Examples

  • Error Account_Import Invalid field for upsert, must be an External Id custom or standard indexed field: Code__c (12:34)

Resolution

{1} uses field {2} for an upsert, but it is not an External Id in the target org.
- Check that {2} is declared as externalId in its field file
- With delta deployments, an item that did not change in the Pull Request is not deployed: change it in the Pull Request, or turn on useDeltaDeploymentWithDependencies (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)
- If it is declared as externalId and deployed, set it manually as External Id in the target org

Invalid type

Detection

  • RegExp: Error (.*) Invalid type: (.*) \((.*)\)

Examples

  • Error AccountService Invalid type: AccountHelper (12:8)

Resolution

Apex {1} uses type {2} (position {3}), unknown in the target org.
- If {2} is an Apex class of the project, deploy it: retrieve it from your org with the Metadata Retriever of VS Code, commit it and save your User Story: sfdx-hardis adds it to manifest/package.xml
- With delta deployments, an item that did not change in the Pull Request is not deployed: change it in the Pull Request, or turn on useDeltaDeploymentWithDependencies (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)
- If {2} is a typo, fix it in {1}

Campaign can not be updated

Detection

  • String: The object "Campaign" can't be updated

Examples

  • Error Spring_Campaign The object "Campaign" can't be updated

Resolution

Campaigns need the Marketing User checkbox on the user.
- In the target org, check Marketing User on the user of the CI/CD deployments (Setup -> Users)
- In a scratch org, add MarketingUser to the features of project-scratch-def.json

Missing field MiddleName

Detection

Examples

  • Error ContactService Variable does not exist: MiddleName (8:20)

Resolution

Middle names must be activated in the target org.
- Turn it on from git: commit force-app/main/default/settings/Name.settings-meta.xml with <enableMiddleName>true</enableMiddleName> (retrieve it with the Metadata Retriever of VS Code), and deploy it in a Pull Request merged before this one
- Or activate them in Setup -> User Interface -> "Enable Middle Names for Person Names"
- Scratch org setting:
"nameSettings": {
  "enableMiddleName": true
}

Missing field Suffix

Detection

  • String: field Suffix

Examples

  • Error Contact_Form Invalid field Suffix for SObject Contact

Resolution

Name suffixes must be activated in the target org.
- Turn it on from git: commit force-app/main/default/settings/Name.settings-meta.xml with <enableNameSuffix>true</enableNameSuffix> (retrieve it with the Metadata Retriever of VS Code), and deploy it in a Pull Request merged before this one
- Or activate them in Setup -> User Interface -> "Enable Name Suffixes for Person Names"
- Scratch org setting:
"nameSettings": {
  "enableNameSuffix": true
}

Missing field SyncedQuoteId

Detection

  • String: field SyncedQuoteId
  • String: Error force-app/main/default/objects/Quote/Quote.object-meta.xml
  • String: Error force-app/main/default/objects/Opportunity/fields/SyncedQuoteId.field-meta.xml

Examples

  • Error Opportunity_Form Invalid field SyncedQuoteId for SObject Opportunity

Resolution

Quotes must be activated in the target org.
- Turn it on from git: commit force-app/main/default/settings/Quote.settings-meta.xml with <enableQuote>true</enableQuote> (retrieve it with the Metadata Retriever of VS Code), and deploy it in a Pull Request merged before this one
- Or activate them in Setup -> Quote Settings (https://help.salesforce.com/articleView?id=sf.quotes_enable.htm&type=5)
- Scratch org setting:
"quoteSettings": {
  "enableQuote": true
}

Missing feature ContactToMultipleAccounts

Detection

Examples

  • Error Admin In field: field - no CustomObject named AccountContactRelation found
  • Error Contact-Contact Layout Invalid field:ACCOUNT.NAME in related list:RelatedContactAccountRelationList

Resolution

Contacts to Multiple Accounts must be activated in the target org.
- The deployment action below activates it in the target org before the deployment (Browserforce)
- Help: https://help.salesforce.com/articleView?id=sf.shared_contacts_set_up.htm&type=5
- Scratch org setting:
"features": ["ContactsToMultipleAccounts"]

Deployment action

A deployment action can solve this error. Create it on the Pull Request of the current branch:

sf hardis:project:action:create --agent --scope pr --pr-id current --when pre-deploy --type browser --label "Enable Contacts to Multiple Accounts" --browser-setting relateContactToMultipleAccounts --browser-config '{"enabled":true}'

A deployment check only simulates a browser action. If this check still fails on this error once the action is created, apply the setting once in the target org with the Run in another org button of the VS Code Deployment Actions tab, or with sf hardis:project:action:run --select-org, then run the check again.

Documentation: https://amtrack.github.io/sfdx-browserforce-plugin/settings/relateContactToMultipleAccounts/


Missing feature Chatter Collaboration Group

Detection

Examples

  • Error Admin In field: field - no CustomObject named CollaborationGroup found

Resolution

Chatter must be enabled in the target org, with records allowed in groups.
- Turn it on from git: commit force-app/main/default/settings/Chatter.settings-meta.xml with <allowRecordsInChatterGroup>true</allowRecordsInChatterGroup> (retrieve it with the Metadata Retriever of VS Code), and deploy it in a Pull Request merged before this one
- Or in Setup -> Chatter Settings -> Allow Records in Groups
- Scratch org setting:
"chatterSettings": {
  "allowRecordsInChatterGroup": true
}

Missing feature Enhanced notes

Detection

Examples

  • Error Account-Account Layout In field: QuickAction - no QuickAction named FeedItem.ContentNote found

Resolution

Enhanced Notes must be activated in the target org.
- Turn it on from git: commit force-app/main/default/settings/EnhancedNotes.settings-meta.xml with <enableEnhancedNotes>true</enableEnhancedNotes> (retrieve it with the Metadata Retriever of VS Code), and deploy it in a Pull Request merged before this one
- Or in Setup -> Notes Settings -> Enable Notes
- Scratch org setting:
"enhancedNotesSettings": {
  "enableEnhancedNotes": true
}

Missing feature Ideas notes

Detection

Examples

  • Error Admin In field: recordType - no RecordType named Idea.InternalIdeasIdeaRecordType found

Resolution

Ideas must be activated in the target org.
- Turn it on from git: commit force-app/main/default/settings/Ideas.settings-meta.xml with <enableIdeas>true</enableIdeas> (retrieve it with the Metadata Retriever of VS Code), and deploy it in a Pull Request merged before this one
- Or in Setup, see https://help.salesforce.com/articleView?id=networks_enable_ideas.htm&type=0
- Scratch org setting:
"ideasSettings": {
  "enableIdeas": true
}

Missing feature Live Agent

Detection

  • String: LiveChatTranscript
  • String: LiveChatButton
  • String: LiveChatDeployment
  • String: LiveAgentSession
  • Replaces: Custom object not found

Examples

  • Error Admin In field: field - no CustomObject named LiveChatTranscript found

Resolution

Chat (formerly Live Agent) must be activated in the target org.
- Turn it on from git: commit force-app/main/default/settings/LiveAgent.settings-meta.xml with <enableLiveAgent>true</enableLiveAgent> (retrieve it with the Metadata Retriever of VS Code), and deploy it in a Pull Request merged before this one
- Or in Setup -> Chat Settings -> Enable Chat
- Scratch org feature: LiveAgent

Missing feature Product Request

Detection

Examples

  • Error Admin In field: field - no CustomObject named ProductRequest found

Resolution

The ProductRequest object is not available in the target org.
- Remove its references from profiles and permission sets: sf hardis:project:clean:references --type productrequest
- Add productrequest to autoCleanTypes in .sfdx-hardis.yml, so sfdx-hardis removes them each time a User Story is saved (https://sfdx-hardis.cloudity.com/salesforce-devops-config-cleaning/)

Missing feature Social Customer Service

Detection

Examples

  • Error Admin In field: field - no CustomField named SocialPersona.AreWeFollowing found

Resolution

Social Customer Service must be activated in the target org.
- Org: Setup -> https://help.salesforce.com/articleView?id=sf.social_customer_service_setup_enable.htm&type=5
- Scratch org feature: SocialCustomerService

Missing feature Translation Workbench

Detection

  • RegExp: report-meta.xml(.*)filterlanguage

Examples

  • Error force-app/main/default/reports/Sales/Pipeline.report-meta.xml Sales/Pipeline Invalid value for filterlanguage

Resolution

The Translation Workbench must be activated in the target org.
- Turn it on from git: commit force-app/main/default/settings/Language.settings-meta.xml with <enableTranslationWorkbench>true</enableTranslationWorkbench> (retrieve it with the Metadata Retriever of VS Code), and deploy it in a Pull Request merged before this one
- Or in Setup, see https://help.salesforce.com/articleView?id=sf.customize_wbench.htm&type=5
- Scratch org setting:
"languageSettings": {
  "enableTranslationWorkbench":  true,
  "enableEndUserLanguages": true
}

Missing feature Opportunity Teams

Detection

Examples

  • Error Admin In field: field - no CustomObject named OpportunityTeamMember found

Resolution

Opportunity Teams must be activated in the target org.
- Turn it on from git: commit force-app/main/default/settings/Opportunity.settings-meta.xml with <enableOpportunityTeam>true</enableOpportunityTeam> (retrieve it with the Metadata Retriever of VS Code), and deploy it in a Pull Request merged before this one
- Or in Setup -> Opportunity Team Settings -> Enable Team Selling
- Scratch org setting:
"opportunitySettings": {
  "enableOpportunityTeam": true
}

Missing Feature Work.Com

Detection

Examples

  • Error Admin In field: field - no CustomObject named WorkBadgeDefinition found

Resolution

Work.com feature must be activated in the target org.
- Org & Scratch: https://developer.salesforce.com/docs/atlas.en-us.workdotcom_dev_guide.meta/workdotcom_dev_guide/wdc_cc_setup_dev_org.htm

Missing multi-currency field

Detection

  • RegExp: A reference to a custom field (.*)CurrencyIsoCode
  • RegExp: no CustomField named (.*)\.CurrencyIsoCode found
  • Replaces: Custom field not found

Examples

  • Error Admin In field: field - no CustomField named Account.CurrencyIsoCode found

Resolution

Multiple currencies are not activated in the target org.
- Activate them in Setup -> Company Information -> Currency Setup: this can not be undone, so check it with the owner of the org
- In a scratch org, add MultiCurrency to the features of project-scratch-def.json
- If the target org must stay single currency, remove the CurrencyIsoCode references from your sources: list the items in a destructiveChanges.xml file, then sf hardis:project:clean:references --config <that file> removes every reference to them from your sources

Missing object referenced in package.xml

Detection

  • RegExp: An object (.*) of type (.*) was named in package.xml, but was not found in zipped directory

Examples

  • Error Invoice__c An object Invoice__c of type CustomObject was named in package.xml, but was not found in zipped directory

Resolution

manifest/package.xml names {2} {1}, which is not in your sources.
- Save your User Story again: sfdx-hardis builds manifest/package.xml from the files of git
- Or add the missing {2} {1} to your sources: retrieve it from your org with the Metadata Retriever of VS Code, commit it and save your User Story: sfdx-hardis adds it to manifest/package.xml

Missing Quick Action

Detection

  • RegExp: Error (.*) In field: QuickAction - no QuickAction named (.*) found

Examples

  • Error Account-Account Layout In field: QuickAction - no QuickAction named Account.New_Case found

Resolution

QuickAction {2} used in {1} is unknown in the target org. You can:
- Deploy {2}: retrieve it from your org with the Metadata Retriever of VS Code, commit it and save your User Story: sfdx-hardis adds it to manifest/package.xml
- With delta deployments, an item that did not change in the Pull Request is not deployed: change it in the Pull Request, or turn on useDeltaDeploymentWithDependencies (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)
- If {2} is a standard QuickAction, enable its feature in the target org
- If {2} exists in some orgs only, add a replacement rule that removes it before each deployment to the orgs that refuse it (https://sfdx-hardis.cloudity.com/salesforce-devops-config-replacement-rules/):
  sf hardis:project:replacement:create --agent --layer project --id remove-unknown-quick-action --type xml-remove --files "**/layouts/*.layout-meta.xml" --xml-path "Layout/quickActionList/quickActionListItems[quickActionName={2}]" --include-branches TARGET_BRANCH

Missing report

Detection

  • RegExp: Error (.*) The (.*) report chart has a problem with the "reportName" field

Examples

  • Error Sales_Dashboard The Pipeline report chart has a problem with the "reportName" field

Resolution

{1} uses report {2}, which is not in the target org.
- Deploy it: retrieve it from your org with the Metadata Retriever of VS Code, commit it and save your User Story: sfdx-hardis adds it to manifest/package.xml. With a command: sf project retrieve start -m Report:FOLDER_NAME/{2}
- With delta deployments, an item that did not change in the Pull Request is not deployed: change it in the Pull Request, or turn on useDeltaDeploymentWithDependencies (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)
- If business users maintain the report in the org, list it in manifest/package-no-overwrite.xml, so CI/CD deploys it only once (https://sfdx-hardis.cloudity.com/salesforce-devops-config-overwrite/)

Missing Sales Team

Detection

Examples

  • Error Account-Account Layout Invalid field:TEAM.MEMBER in related list:RelatedAccountSalesTeam

Resolution

Account Teams must be activated in the target org.
- Turn it on from git: commit force-app/main/default/settings/Account.settings-meta.xml with <enableAccountTeams>true</enableAccountTeams> (retrieve it with the Metadata Retriever of VS Code), and deploy it in a Pull Request merged before this one
- Or in Setup -> Account Teams -> Enable
- Scratch org setting:
"accountSettings": {
  "enableAccountTeams": true
}

sharing operation already in progress

Detection

  • String: sharing operation already in progress

Examples

  • Error Account sharing operation already in progress

Resolution

Salesforce refuses a sharing rule change while it recalculates sharing.
- Run the job again once the sharing recalculation of the target org is done
- Deliver sharing rule changes in their own User Story, so they are not deployed with every change
- If sharing rules are maintained in the org, list them in manifest/package-no-overwrite.xml (https://sfdx-hardis.cloudity.com/salesforce-devops-config-overwrite/)
- In a scratch org, add DeferSharingCalc to the features of project-scratch-def.json

Network issue

Detection

  • String: ECONNABORTED
  • String: ECONNRESET

Examples

  • Error (1): read ECONNRESET

Resolution

The network connection to Salesforce was lost: there is nothing to fix in the metadata.
- Run the job again
- If it goes on, check the status of the Salesforce instance on https://status.salesforce.com

Not available for deploy for this organization

Detection

  • RegExp: Error (.*) Not available for deploy for this organization

Examples

  • Error Sales_Policy Not available for deploy for this organization

Resolution

The user of the CI/CD deployments probably lacks the rights (profile, permission sets...) to manage {1}, or the feature of {1} is not enabled in the target org.
- Assign the needed permission sets to the user of the CI/CD deployments (the user of the connected app of the branch), then run the job again
- If {1} is a User Access Policy, enable User Access Policies in the target org first (Setup -> User Management Settings)
- If {1} only exists in some orgs, remove it from the deployment to the others with a deployment action of type remove-packagexml-items (https://sfdx-hardis.cloudity.com/salesforce-devops-work-on-user-story-deployment-actions-remove-packagexml-items/)

Not valid sharing model

Detection

Examples

  • Error Invoice__c ReadWrite is not a valid sharing model for Invoice__c when Account sharing model is Private

Resolution

The sharing models of {1} and {4} are not compatible in the target org.
- Use compatible sharing models for {1} and {4}, in their object files: for example, replace <sharingModel>ReadWrite</sharingModel> by <sharingModel>Private</sharingModel> in {3}.object-meta.xml
- Deploy {1} and {4} together: With delta deployments, an item that did not change in the Pull Request is not deployed: change it in the Pull Request, or turn on useDeltaDeploymentWithDependencies (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)

Picklist sharing is not supported

Detection

  • String: Picklist sharing is not supported

Examples

  • Error Account.Type__c Picklist sharing is not supported

Resolution

You probably changed the type of a field.
- Make the change manually in the target org before the deployment
- The manual deployment action below reminds to do it in each org of the pipeline, with a checkbox in the Pull Request comments

Deployment action

A deployment action can solve this error. Create it on the Pull Request of the current branch:

sf hardis:project:action:create --agent --scope pr --pr-id current --when pre-deploy --type manual --label "Change the type of the field before the deployment" --instructions "1. In Setup, open Object Manager, the object of the field, then Fields & Relationships
2. Open the field, click Change Field Type and select the type it has in the sources
3. If it already has this type, there is nothing to do"

Documentation: https://sfdx-hardis.cloudity.com/salesforce-devops-work-on-user-story-deployment-actions-manual/


Picklist value not found

Detection

  • RegExp: Picklist value: (.*) in picklist: (.*) not found

Examples

  • Error Account.Partner Picklist value: Hot in picklist: Rating__c not found

Resolution

Sources refer to value {1} of picklist {2}, which the target org does not have.
- If picklist {2} is standard, retrieve its StandardValueSet {2} with the Metadata Retriever of VS Code, commit it and save your User Story
- With delta deployments, an item that did not change in the Pull Request is not deployed: change it in the Pull Request, or turn on useDeltaDeploymentWithDependencies (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)
- If value {1} was removed on purpose, remove the XML tags that still refer to it (record types...)
- If value {1} exists but is inactive in the target org, the deployment action below can activate it: replace OBJECT_NAME by the object of picklist {2} (or, for a standard value set, use "metadataType":"StandardValueSet" and "metadataFullName":"{2}")
- If value {1} was renamed in the sources, rename it in the target org instead: the same picklists setting does it with "newApiName" (https://amtrack.github.io/sfdx-browserforce-plugin/settings/picklists/)

Deployment action

A deployment action can solve this error. Create it on the Pull Request of the current branch:

sf hardis:project:action:create --agent --scope pr --pr-id current --when pre-deploy --type browser --label "Activate value {1} of picklist {2}" --browser-setting picklists --browser-config '{"picklistValues":[{"metadataType":"CustomField","metadataFullName":"OBJECT_NAME.{2}","value":"{1}","active":true}]}'

Before running it, replace OBJECT_NAME in the command with the real value.

A deployment check only simulates a browser action. If this check still fails on this error once the action is created, apply the setting once in the target org with the Run in another org button of the VS Code Deployment Actions tab, or with sf hardis:project:action:run --select-org, then run the check again.

Documentation: https://amtrack.github.io/sfdx-browserforce-plugin/settings/picklists/


Please choose a different name

Detection

  • RegExp: Error (.*) This (.*) already exists or has been previously used(.*)Please choose a different name.

Examples

  • Error Invoice__c This Invoice already exists or has been previously used. Please choose a different name.

Resolution

An item named {1} exists, or existed, in the target org: deleted items keep their name for 15 days.
- If a deleted field holds the name, erase it in the target org: Setup -> Object Manager -> the object -> Deleted Fields -> Erase
- Or rename the existing {1} in the target org, deploy, then delete the renamed item
- The manual deployment action below reminds to do it in each org of the pipeline, with a checkbox in the Pull Request comments

Deployment action

A deployment action can solve this error. Create it on the Pull Request of the current branch:

sf hardis:project:action:create --agent --scope pr --pr-id current --when pre-deploy --type manual --label "Free the name {1}" --instructions "1. In Setup, open Object Manager, the object of {1}, then Deleted Fields (or the list of deleted items of its type)
2. Erase the deleted item named {1}, or rename the existing one
3. If no item uses the name {1} anymore, there is nothing to do"

Documentation: https://sfdx-hardis.cloudity.com/salesforce-devops-work-on-user-story-deployment-actions-manual/


Missing profile default application

Detection

  • String: You can't remove the only default app from the profile.

Examples

  • Error Sales You can't remove the only default app from the profile.

Resolution

You must have a default application for a profile. You can:
 - Update it in UI
 - Update the XML of the profile to set "true" in the <default> tag of one of the applicationVisibilities item.
 Ex:
 <applicationVisibilities>
    <application>standard__LightningSales</application>
    <default>true</default>
    <visible>true</visible>
</applicationVisibilities>

CRM Analytics: A Recipe must specify a DataFlow

Detection

  • RegExp: Error (.*) A Recipe must specify a Dataflow

Examples

  • Error Sales_Recipe A Recipe must specify a Dataflow

Resolution

Recipe {1} needs its WaveDataFlow {1} in the deployment.
- Retrieve it with the Metadata Retriever of VS Code (or sf project retrieve start -m WaveDataFlow:{1} -o SOURCE_ORG_USERNAME), commit it and save your User Story
- Or retrieve all the CRM Analytics sources at once with sf hardis:org:retrieve:source:analytics -o SOURCE_ORG_USERNAME
- With delta deployments, an item that did not change in the Pull Request is not deployed: change it in the Pull Request, or turn on useDeltaDeploymentWithDependencies (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)
  - https://salesforce.stackexchange.com/a/365453/33522
  - https://help.salesforce.com/s/articleView?id=000319274&type=1

Record Type not found

Detection

  • RegExp: Error (.*) In field: recordType - no RecordType named (.*) found

Examples

  • Error Admin In field: recordType - no RecordType named Account.Partner found

Resolution

{1} refers to record type {2}, which is not in the target org.
- If {2} must exist: retrieve it from your org with the Metadata Retriever of VS Code, commit it and save your User Story: sfdx-hardis adds it to manifest/package.xml. Record types are often missed by a pull: add RecordType to autoRetrieveWhenPull in .sfdx-hardis.yml (https://sfdx-hardis.cloudity.com/salesforce-devops-retrieve/)
- With delta deployments, an item that did not change in the Pull Request is not deployed: change it in the Pull Request, or turn on useDeltaDeploymentWithDependencies (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)
- If {2} must not exist: list the items in a destructiveChanges.xml file, then sf hardis:project:clean:references --config <that file> removes every reference to them from your sources

Objects rights on a role is below org default

Detection

  • String: access level below organization default

Examples

  • Error Sales_Manager access level below organization default

Resolution

A role gives a lower access than the organization wide default of the object in the target org.
- In a scratch org, set the default with objectProperties in project-scratch-def.json (see "Set Object-Level Sharing Settings" in https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_scratch_orgs_def_file.htm)
- In a sandbox or production, deploy the sharing model of the object first (its <sharingModel> in the object file), or set it in Setup -> Sharing Settings
- With delta deployments, an item that did not change in the Pull Request is not deployed: change it in the Pull Request, or turn on useDeltaDeploymentWithDependencies (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)

Unsupported sharing configuration

Detection

  • RegExp: not supported for (.*) since it's org wide default is

Examples

  • Error Contact Sharing rules are not supported for Contact since it's org wide default is Controlled by Parent

Resolution

The sharing rules of {1} do not match the sharing model of {1} in the target org.
- Deploy the sharing model of {1} (its <sharingModel> in the object file) with its sharing rules: With delta deployments, an item that did not change in the Pull Request is not deployed: change it in the Pull Request, or turn on useDeltaDeploymentWithDependencies (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)
- See https://salesforce.stackexchange.com/questions/260923/sfdx-deploying-contact-sharing-rules-on-a-fresh-deployment
- If you already did that, run the job again: the sharing recalculation of the target org may have been running

A sharing rule may be useless

Detection

  • String: Required field is missing: sharingCriteriaRules

Examples

  • Error Account Required field is missing: sharingCriteriaRules

Resolution

This sharing rules file has no rule: it was probably retrieved empty.
- Remove the empty items with sf hardis:project:clean:emptyitems
- Add emptyItems to autoCleanTypes in .sfdx-hardis.yml, so sfdx-hardis removes them each time a User Story is saved (https://sfdx-hardis.cloudity.com/salesforce-devops-config-cleaning/)

Sharing recalculation lock

Detection

  • String: because it interferes with another operation already in progress
  • String: Le calcul de partage demandé ne peut être traité maintenant car il interfère avec une autre opération en cours
  • String: The sharing calculation you requested can't be processed right now

Examples

  • Error Account The sharing calculation you requested can't be processed now because it interferes with another operation already in progress

Resolution

Another sharing recalculation is running in the target org.
- Wait for it to finish, then run the job again
- If you changed a field from MasterDetail to Lookup, you must do it manually in the target org before being able to deploy

Send email is disabled

Detection

  • String: Send Email is disabled or activities are not allowed
  • String: Unknown user permission: SendExternalEmailAvailable
  • Replaces: Unknown user permission

Examples

  • Error Admin Unknown user permission: SendExternalEmailAvailable

Resolution

Email deliverability of the target org does not allow all emails.
- The deployment action below sets it to "All email" before the deployment (Browserforce)
- Or do it manually: Setup -> Deliverability -> Access level "All email"

Deployment action

A deployment action can solve this error. Create it on the Pull Request of the current branch:

sf hardis:project:action:create --agent --scope pr --pr-id current --when pre-deploy --type browser --label "Allow all emails in Deliverability" --browser-setting emailDeliverability --browser-config '{"accessLevel":"All email"}'

A deployment check only simulates a browser action. If this check still fails on this error once the action is created, apply the setting once in the target org with the Run in another org button of the VS Code Deployment Actions tab, or with sf hardis:project:action:run --select-org, then run the check again.

Documentation: https://amtrack.github.io/sfdx-browserforce-plugin/settings/emailDeliverability/


Shared Activities can not be deployed

Detection

  • String: You can't use the Tooling API or Metadata API to enable or disable Shared Activities

Examples

  • Error Activity You can't use the Tooling API or Metadata API to enable or disable Shared Activities. To enable this feature, visit the Activity Settings page in Setup.

Resolution

The Metadata API can not change Shared Activities (Allow Users to Relate Multiple Contacts to Tasks and Events)
- Remove allowUsersToRelateMultipleContactsToTasksAndEvents from Activities.settings-meta.xml in your sources
- To enable it, go to Setup -> Activity Settings in the target org, or use a deployment action
- Once enabled, it can not be disabled (only Salesforce support can)

Deployment action

A deployment action can solve this error. Create it on the Pull Request of the current branch:

sf hardis:project:action:create --agent --scope pr --pr-id current --when pre-deploy --type browser --label "Enable Shared Activities" --browser-setting activitySettings --browser-config '{"allowUsersToRelateMultipleContactsToTasksAndEvents":true}'

A deployment check only simulates a browser action. If this check still fails on this error once the action is created, apply the setting once in the target org with the Run in another org button of the VS Code Deployment Actions tab, or with sf hardis:project:action:run --select-org, then run the check again.

Documentation: https://amtrack.github.io/sfdx-browserforce-plugin/settings/activitySettings/


Einstein Conversation Insights not enabled

Detection

  • RegExp: There was an error enabling or disabling a setting: OrgPreferences\.(CallSummarization|GenECI)
  • RegExp: Error ConversationalIntelligence (enableECICallScoring)\s*$

Examples

  • Error ConversationalIntelligence There was an error enabling or disabling a setting: OrgPreferences.GenECI

Resolution

The ConversationalIntelligence settings of your sources turn on {1}, that needs Einstein Conversation Insights already turned on in the target org: turning it on in the same deployment is not enough
- Turn on Einstein Conversation Insights in the target org (Setup -> Einstein Conversation Insights), or use a deployment action that waits until it is completely on
- Once turned on, it can not be turned off with Browserforce
- If Call Summaries still fails to turn on with the Metadata API, remove enableCallSummarization from ConversationalIntelligence.settings-meta.xml and use the callSummaries setting of Browserforce instead (https://amtrack.github.io/sfdx-browserforce-plugin/settings/callSummaries/)

Deployment action

A deployment action can solve this error. Create it on the Pull Request of the current branch:

sf hardis:project:action:create --agent --scope pr --pr-id current --when pre-deploy --type browser --label "Turn on Einstein Conversation Insights" --browser-setting einsteinConversationInsights --browser-config '{"enabled":true}'

A deployment check only simulates a browser action. If this check still fails on this error once the action is created, apply the setting once in the target org with the Run in another org button of the VS Code Deployment Actions tab, or with sf hardis:project:action:run --select-org, then run the check again.

Documentation: https://amtrack.github.io/sfdx-browserforce-plugin/settings/einsteinConversationInsights/


Lightning Experience theme not found

Detection

  • RegExp: no LightningExperienceTheme named (.*) found

Examples

  • Error LightningExperience In field: activeThemeName - no LightningExperienceTheme named Lightning found

Resolution

Lightning Experience theme {1} is not in the target org
- If {1} is a custom theme, add LightningExperienceTheme:{1} to your sources
- If {1} is a standard theme (Lightning, LightningBlue...), the Metadata API can not activate it: remove activeThemeName from LightningExperience.settings-meta.xml in your sources, then activate the theme in Setup -> Themes and Branding, or with a deployment action

Deployment action

A deployment action can solve this error. Create it on the Pull Request of the current branch:

sf hardis:project:action:create --agent --scope pr --pr-id current --when pre-deploy --type browser --label "Activate Lightning Experience theme {1}" --browser-setting lightningExperienceSettings --browser-config '{"activeThemeName":"{1}"}'

A deployment check only simulates a browser action. If this check still fails on this error once the action is created, apply the setting once in the target org with the Run in another org button of the VS Code Deployment Actions tab, or with sf hardis:project:action:run --select-org, then run the check again.

Documentation: https://amtrack.github.io/sfdx-browserforce-plugin/settings/lightningExperienceSettings/


History tracking not enabled on object

Detection

  • RegExp: The entity: (.*) does not have history tracking enabled

Examples

  • Error Account.Code__c The entity: Account does not have history tracking enabled

Resolution

A field tracks its history, but history tracking is not enabled on object {1} in the target org
- Enable it in the sources: add <enableHistory>true</enableHistory> to the object {1} metadata and deploy it with the field
- For a Person Account field, the Metadata API can not enable it: use Setup -> Object Manager -> {1} -> Fields & Relationships -> Set History Tracking, or a deployment action

Deployment action

A deployment action can solve this error. Create it on the Pull Request of the current branch:

sf hardis:project:action:create --agent --scope pr --pr-id current --when pre-deploy --type browser --label "Enable history tracking on {1}" --browser-setting historyTracking --browser-config '[{"objectApiName":"{1}","enableHistoryTracking":true}]'

A deployment check only simulates a browser action. If this check still fails on this error once the action is created, apply the setting once in the target org with the Run in another org button of the VS Code Deployment Actions tab, or with sf hardis:project:action:run --select-org, then run the check again.

Documentation: https://amtrack.github.io/sfdx-browserforce-plugin/settings/historyTracking/


Sort order must be in sequential order

Detection

  • RegExp: Error (.*) SortOrder must be in sequential order from

Examples

  • Error Account.Standard_Account_Duplicate_Rule SortOrder must be in sequential order from 1. (Duplicate Rule)

Resolution

The target org probably has a standard Duplicate Rule that is not in your sources.
- Retrieve the duplicate rules of the target org with the Metadata Retriever of VS Code, and commit them
- Or delete the standard rule in the target org, so the order of your sources applies
Ref: https://developer.salesforce.com/forums/?id=9060G000000I6SoQAK

Async exception in test class

Detection

  • RegExp: System.AsyncException: (.*) Apex

Examples

  • Error AccountTest System.AsyncException: Database.executeBatch cannot be called from a batch start, batch execute, or future method. Apex

Resolution

An asynchronous Apex call failed in a test: {1}
- Check the asynchronous calls of the tested code (batch, future, queueable): a batch or a future method can not start another one
- Run the test class on your org before publishing: sf hardis:org:test:apex
- See https://developer.salesforce.com/forums/?id=9060G0000005kVLQAY

Test classes with 0% coverage

Detection

  • RegExp: Error (.*) Test coverage of selected Apex (Trigger|Class) is 0%

Examples

  • Error AccountTrigger Test coverage of selected Apex Trigger is 0%, at least 1% test coverage is required

Resolution

Apex {2} {1} is not covered at all by the test classes of the deployment: every trigger needs at least 1% coverage.
- Add a test class that runs {1}, or add it to the tests of the deployment
- Make sure that none of the classes and triggers of the deployment is 0% covered

Can not test item deployment in simulation mode

Detection

  • RegExp: Test only deployment cannot update

Examples

  • Error Invoice__c.Account__c Test only deployment cannot update a field from a Lookup to MasterDetail

Resolution

THIS IS A FALSE POSITIVE of the deployment check
A validation (check only deployment) can not make this change: the real deployment, after the merge of the Pull Request, will pass

Unknown user permission: CreateAuditFields

Detection

Examples

  • Error Admin Unknown user permission: CreateAuditFields

Resolution

The "Set Audit Fields upon Record Creation" feature is not enabled in the target org.
- Enable it in the target org: Setup -> User Interface -> "Enable Set Audit Fields upon Record Creation and Update Records with Inactive Owners"
- The built-in replacement rule builtin-unknown-user-permissions removes the user permissions the target org does not have: check it is on (https://sfdx-hardis.cloudity.com/salesforce-devops-config-replacement-rules-builtin/)
- The manual deployment action below reminds to do it in each org of the pipeline, with a checkbox in the Pull Request comments

Deployment action

A deployment action can solve this error. Create it on the Pull Request of the current branch:

sf hardis:project:action:create --agent --scope pr --pr-id current --when pre-deploy --type manual --label "Enable Set Audit Fields upon Record Creation" --instructions "1. Open Setup, type User Interface in the Quick Find box, and open User Interface
2. Check \"Enable Set Audit Fields upon Record Creation and Update Records with Inactive Owners\", then Save
3. If it is already checked, there is nothing to do"

Documentation: https://sfdx-hardis.cloudity.com/salesforce-devops-work-on-user-story-deployment-actions-manual/


Unknown user permission: FieldServiceAccess

Detection

Examples

  • Error Admin Unknown user permission: FieldServiceAccess

Resolution

Field Service is not enabled in the target org.
- Enable it in the target org (Setup -> Field Service Settings), see https://help.salesforce.com/articleView?id=sf.fs_enable.htm&type=5
- The built-in replacement rule builtin-unknown-user-permissions removes the user permissions the target org does not have: check it is on (https://sfdx-hardis.cloudity.com/salesforce-devops-config-replacement-rules-builtin/)

Unknown user permission

Detection

  • String: Unknown user permission:

Examples

  • Error Admin Unknown user permission: ManageDataIntegrations

Resolution

The target org does not have this user permission: unknown to its API version, or not enabled by its licenses and features.
- sfdx-hardis removes such permissions before each deployment with the built-in replacement rule builtin-unknown-user-permissions: check it is on in .sfdx-hardis.yml (https://sfdx-hardis.cloudity.com/salesforce-devops-config-replacement-rules-builtin/)
- Or enable the feature that brings the permission in the target org
- Or remove the permission from the profile or permission set

Variable does not exist

Detection

  • RegExp: Error (.*) Variable does not exist: (.*) \((.*)\)

Examples

  • Error AccountService Variable does not exist: accountList (12:8)

Resolution

Apex {1} uses {2} (position {3}), unknown in the target org.
- If {2} is a field, an object or an Apex class of the project, deploy it: retrieve it from your org with the Metadata Retriever of VS Code, commit it and save your User Story: sfdx-hardis adds it to manifest/package.xml
- With delta deployments, an item that did not change in the Pull Request is not deployed: change it in the Pull Request, or turn on useDeltaDeploymentWithDependencies (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)
- If {2} is a typo, fix it in {1}

Visibility is not allowed for type

Detection

  • RegExp: Error (.*?) (?:cannot |Cannot )?set the visibility for a (.*) to Protected unless you are in a developer

Examples

  • Error Config__mdt Cannot set the visibility for a CustomMetadata to Protected unless you are in a developer organization with a namespace

Resolution

Update the visibility of {1} to "Public"

Tableau CRM / Wave digest error

Detection

  • String: Fix the sfdcDigest node errors and then upload the file again

Examples

  • Error Sales_Dataflow Fix the sfdcDigest node errors and then upload the file again

Resolution

The Analytics Cloud Integration User can not read some fields the dataflow extracts.
- Give READ access to those fields in the profile Analytics Cloud Integration User, in git (its .profile-meta.xml), so every org gets it with the deployment
- Or add the access manually in the profile of the target org

Standard application not found

Detection

Examples

  • Error Sales_User In field: application - no CustomApplication named standard__SalesCloudMobile found

Resolution

{1} gives access to the standard application {2}, which is not available in the target org: its feature or license is not enabled there.
- Enable the feature or license that brings {2} in the target org
- Or, to keep it for the orgs that have it, add a replacement rule that removes it before each deployment to the orgs that refuse it (https://sfdx-hardis.cloudity.com/salesforce-devops-config-replacement-rules/):
  sf hardis:project:replacement:create --agent --layer project --id remove-unknown-standard-app --type xml-remove --files "**/profiles/*.profile-meta.xml" --xml-path "Profile/applicationVisibilities[application={2}]" --include-branches TARGET_BRANCH
- Or remove the <applicationVisibilities> block of {2} from {1}

Custom application not found

Detection

  • RegExp: Error (.*) In field: application - no CustomApplication named (.*) found

Examples

  • Error Sales_User In field: application - no CustomApplication named Sales_Console found

Resolution

{1} gives access to the application {2}, which is not in the target org.
- Deploy {2}: retrieve it from your org with the Metadata Retriever of VS Code, commit it and save your User Story: sfdx-hardis adds it to manifest/package.xml. Applications are often missed by a pull: add CustomApplication to autoRetrieveWhenPull in .sfdx-hardis.yml (https://sfdx-hardis.cloudity.com/salesforce-devops-retrieve/)
- With delta deployments, an item that did not change in the Pull Request is not deployed: change it in the Pull Request, or turn on useDeltaDeploymentWithDependencies (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)
- Or remove the <applicationVisibilities> block of {2} from {1}

Permission can not be modified on a standard profile

Detection

  • RegExp: Error (.*) You may not modify the permission (.*) while editing a Standard Profile

Examples

  • Error Read Only You may not modify the permission ViewSetup while editing a Standard Profile

Resolution

A deployment can not give or remove permission {2} on the standard profile {1}.
- Remove the <userPermissions> block of {2} from {1}, and give {2} with a permission set
- The minimizeProfiles cleaning moves such attributes out of profiles at each save: add it to autoCleanTypes in .sfdx-hardis.yml (https://sfdx-hardis.cloudity.com/salesforce-devops-work-on-user-story-profiles/)

Permission depends on other permissions

Detection

  • RegExp: Error (.*) Permission (.*) depends on permission\(s\): (.*)

Examples

  • Error Support Permission ManageCases depends on permission(s): EditCaseComments

Resolution

In {1}, permission {2} needs {3}.
- Add the <userPermissions> of {3} with <enabled>true</enabled> to {1}
- Or remove {2} from {1}

Unknown user permission: Dev Hub permissions

Detection

Examples

  • Error Admin Unknown user permission: packaging2promoteversion

Resolution

Permission {2} only exists in an org where Dev Hub is enabled (usually production): the target org of {1} does not have it.
- sfdx-hardis removes such permissions before each deployment with the built-in replacement rule builtin-unknown-user-permissions: check it is on (https://sfdx-hardis.cloudity.com/salesforce-devops-config-replacement-rules-builtin/)
- Or remove the <userPermissions> block of {2} from {1}

Custom tab not found

Detection

  • RegExp: Error (.*) In field: tab - no CustomTab named (.*) found

Examples

  • Error Admin In field: tab - no CustomTab named Invoice__c found

Resolution

{1} sets the visibility of tab {2}, which is not in the target org.
- If {2} is a custom tab, deploy it: retrieve it from your org with the Metadata Retriever of VS Code, commit it and save your User Story: sfdx-hardis adds it to manifest/package.xml
- With delta deployments, an item that did not change in the Pull Request is not deployed: change it in the Pull Request, or turn on useDeltaDeploymentWithDependencies (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)
- If {2} is a standard tab of a feature some orgs do not have, add a replacement rule that removes it before each deployment to the orgs that refuse it (https://sfdx-hardis.cloudity.com/salesforce-devops-config-replacement-rules/):
  sf hardis:project:replacement:create --agent --layer project --id remove-unknown-tab --type xml-remove --files "**/profiles/*.profile-meta.xml" --xml-path "Profile/tabVisibilities[tab={2}]" --include-branches TARGET_BRANCH

Custom permission not found

Detection

  • RegExp: Error (.*) In field: customPermission - no CustomPermission named (.*) found

Examples

  • Error Admin In field: customPermission - no CustomPermission named Bypass_Validation found

Resolution

{1} grants custom permission {2}, which is not in the target org.
- Deploy {2}: retrieve it from your org with the Metadata Retriever of VS Code, commit it and save your User Story: sfdx-hardis adds it to manifest/package.xml
- With delta deployments, an item that did not change in the Pull Request is not deployed: change it in the Pull Request, or turn on useDeltaDeploymentWithDependencies (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)
- Or remove the <customPermissions> block of {2} from {1}

Apex class access not found

Detection

  • RegExp: Error (.*) In field: apexClass - no ApexClass named (.*) found

Examples

  • Error Admin In field: apexClass - no ApexClass named InvoiceController found

Resolution

{1} gives access to Apex class {2}, which is not in the target org.
- Deploy {2}: retrieve it from your org with the Metadata Retriever of VS Code, commit it and save your User Story: sfdx-hardis adds it to manifest/package.xml
- With delta deployments, an item that did not change in the Pull Request is not deployed: change it in the Pull Request, or turn on useDeltaDeploymentWithDependencies (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)
- Apex class accesses belong in permission sets: the minimizeProfiles cleaning moves them out of profiles (https://sfdx-hardis.cloudity.com/salesforce-devops-work-on-user-story-profiles/)

Tab settings on an object without tab

Detection

  • RegExp: Error (.*) You can't edit tab settings for (.*), as it's not a valid tab

Examples

  • Error Admin You can't edit tab settings for Invoice__c, as it's not a valid tab.

Resolution

{1} sets the visibility of the tab of {2}, but {2} has no tab in the target org.
- Deploy the CustomTab of {2}: retrieve it from your org with the Metadata Retriever of VS Code, commit it and save your User Story: sfdx-hardis adds it to manifest/package.xml
- With delta deployments, an item that did not change in the Pull Request is not deployed: change it in the Pull Request, or turn on useDeltaDeploymentWithDependencies (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)
- Or remove the <tabVisibilities> block of {2} from {1}

QuickText is not a valid tab

Detection

  • String: QuickText is not a valid Tab

Examples

  • Error Admin QuickText is not a valid Tab

Resolution

Quick Text is not enabled in the target org.
- Enable Quick Text in the target org (Setup -> Quick Text Settings)
- Or, to keep it for the orgs that have it, add a replacement rule that removes it before each deployment to the orgs that refuse it (https://sfdx-hardis.cloudity.com/salesforce-devops-config-replacement-rules/):
  sf hardis:project:replacement:create --agent --layer project --id remove-quick-text-tab --type xml-remove --files "**/profiles/*.profile-meta.xml" --xml-path "Profile/tabVisibilities[tab=standard-QuickText]" --include-branches TARGET_BRANCH

Profile referenced elsewhere

Detection

  • RegExp: Error (.*) This profile is referenced elsewhere in Salesforce

Examples

  • Error Old_Sales_Profile This profile is referenced elsewhere in Salesforce. Remove the usage and try again.

Resolution

Profile {1} can not be deleted while something uses it in the target org (users, a Login Flow, a Connected App...).
- Assign its users to another profile, and remove the other usages in the target org
- Then run the job again
- The manual deployment action below reminds to do it in each org of the pipeline, with a checkbox in the Pull Request comments

Deployment action

A deployment action can solve this error. Create it on the Pull Request of the current branch:

sf hardis:project:action:create --agent --scope pr --pr-id current --when pre-deploy --type manual --label "Free profile {1} before its deletion" --instructions "1. In Setup, open Users, and give another profile to the users of {1}
2. Check that no Login Flow and no Connected App uses {1}
3. If no user has {1} anymore, there is nothing to do"

Documentation: https://sfdx-hardis.cloudity.com/salesforce-devops-work-on-user-story-deployment-actions-manual/


Cannot modify managed object

Detection

  • RegExp: Error (.*) Cannot modify managed object: entity=(\w+), component=(\w+)

Examples

  • Error acme__Admin Cannot modify managed object: entity=CustomPermissionSet, component=0PSAa000000AbCd, field=Description, state=installed

Resolution

{1} belongs to a managed package installed in the target org: only the vendor of the package can change it.
- Remove the items of the package from your sources: sf hardis:project:clean:manageditems --namespace <namespace>
- Or let the deployment action below remove {1} from package.xml before each deployment
- Install the same package version in every org, from the Installed Packages panel of VS Code (https://sfdx-hardis.cloudity.com/salesforce-devops-work-on-user-story-install-packages/)

Deployment action

A deployment action can solve this error. Create it on the Pull Request of the current branch:

sf hardis:project:action:create --agent --scope pr --pr-id current --when pre-deploy --type remove-packagexml-items --label "Remove managed item {1} from package.xml" --packagexml-items "METADATA_TYPE:{1}"

Before running it, replace METADATA_TYPE in the command with the real value.

Documentation: https://sfdx-hardis.cloudity.com/salesforce-devops-work-on-user-story-deployment-actions-remove-packagexml-items/


Namespace not available in the target org

Detection

  • RegExp: Error (.*) Cannot create a new component with the namespace: (\w+)

Examples

  • Error acme__Score__c Cannot create a new component with the namespace: acme. Only components in the same namespace as the organization can be created through the API

Resolution

{1} uses namespace {2}, and the target org has neither this namespace nor the package that brings it.
- Declare the package in the Installed Packages panel of VS Code with the Deployments flag: sfdx-hardis installs it in the major orgs before deploying (https://sfdx-hardis.cloudity.com/salesforce-devops-work-on-user-story-install-packages/)
- If a Pull Request validation fails because the package is missing, set installPackagesDuringCheckDeploy: true in .sfdx-hardis.yml
- Or remove the {2}__ items from your sources: sf hardis:project:clean:manageditems --namespace {2}

Workflow Rules not allowed in this org

Detection

  • String: Cannot use: WorkflowRule in this organization
  • Applies to: component errors, deployment errors

Examples

  • INVALID_TYPE: Cannot use: WorkflowRule in this organization

Resolution

The edition of the target org does not allow Workflow Rules.
- Migrate the Workflow Rules to Flows (Setup -> Migrate to Flow)
- Meanwhile, let the deployment action below remove them from package.xml before each deployment to this org

Deployment action

A deployment action can solve this error. Create it on the Pull Request of the current branch:

sf hardis:project:action:create --agent --scope pr --pr-id current --when pre-deploy --type remove-packagexml-items --label "Remove Workflow Rules from package.xml" --packagexml-items "WorkflowRule:*"

Documentation: https://sfdx-hardis.cloudity.com/salesforce-devops-work-on-user-story-deployment-actions-remove-packagexml-items/


ControlledByParent sharing without Master-Detail field

Detection

  • RegExp: Error (.*) Cannot set sharingModel to ControlledByParent on a CustomObject without a MasterDetail relationship field

Examples

  • Error Invoice_Line__c Cannot set sharingModel to ControlledByParent on a CustomObject without a MasterDetail relationship field

Resolution

{1} is deployed with sharing model ControlledByParent, but its Master-Detail field is not in the deployment.
- With delta deployments, an item that did not change in the Pull Request is not deployed: change it in the Pull Request, or turn on useDeltaDeploymentWithDependencies (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)
- Or deploy the Master-Detail field in an earlier Pull Request, then {1}

Own sharing model with a Master-Detail field

Detection

  • RegExp: Error (.*) Cannot set sharingModel to (\w+) on a CustomObject with a MasterDetail relationship field

Examples

  • Error Invoice_Line__c Cannot set sharingModel to ReadWrite on a CustomObject with a MasterDetail relationship field

Resolution

{1} has a Master-Detail field, so its sharing model must be ControlledByParent.
- Set <sharingModel>ControlledByParent</sharingModel> (and <externalSharingModel>) in the object file of {1}
- Or change the Master-Detail field into a Lookup first, if {1} needs its own sharing model

Invalid sharing model for object

Detection

  • RegExp: Error (.*) (\w+) is not a valid sharing model for (\w+)

Examples

  • Error Asset ControlledByParent is not a valid sharing model for Asset

Resolution

Sharing model {2} is not allowed for {3} in the target org.
- Check the sharing models {3} accepts in the target org (Setup -> Sharing Settings)
- Set an accepted value in <sharingModel> and <externalSharingModel> of the object file of {3}

Help text on a platform event field

Detection

  • RegExp: Error (.*) Cannot specify: inlineHelpText for platform event field

Examples

  • Error Order_Event__e.Status__c Cannot specify: inlineHelpText for platform event field

Resolution

Platform event fields do not accept help text: remove <inlineHelpText> from the field file of {1}

Child relationship name already used

Detection

  • RegExp: Error (.*) There is already a Child Relationship named (\S+) on (\w+)

Examples

  • Error Invoice__c.Account__c There is already a Child Relationship named Invoices on Account.

Resolution

A deleted field of the target org still holds the relationship name {2} on {3}: deleted fields stay 15 days in the org.
- Erase the deleted field in the target org before the deployment
- Or give another <relationshipName> to {1}
- The manual deployment action below reminds to do it in each org of the pipeline, with a checkbox in the Pull Request comments

Deployment action

A deployment action can solve this error. Create it on the Pull Request of the current branch:

sf hardis:project:action:create --agent --scope pr --pr-id current --when pre-deploy --type manual --label "Erase the deleted field that holds relationship {2} on {3}" --instructions "1. In Setup, open Object Manager, the object of the deleted field, then Deleted Fields
2. Click Erase next to the field whose relationship name is {2}
3. If no deleted field is listed, there is nothing to do"

Documentation: https://sfdx-hardis.cloudity.com/salesforce-devops-work-on-user-story-deployment-actions-manual/


Unsupported custom field type conversion

Detection

  • RegExp: Error (.*) Unsupported custom field type conversion attempted

Examples

  • Error Account.Code__c Unsupported custom field type conversion attempted.

Resolution

Salesforce can not convert field {1} to its new type with a deployment.
- Change the type of {1} manually in the target org before the deployment, if Setup allows this conversion
- Or create a new field with the new type, and copy the data with a data deployment action (https://sfdx-hardis.cloudity.com/salesforce-devops-work-on-user-story-deployment-actions-data/)
- The manual deployment action below reminds to do it in each org of the pipeline, with a checkbox in the Pull Request comments

Deployment action

A deployment action can solve this error. Create it on the Pull Request of the current branch:

sf hardis:project:action:create --agent --scope pr --pr-id current --when pre-deploy --type manual --label "Change the type of field {1}" --instructions "1. In Setup, open Object Manager, the object of {1}, then Fields & Relationships
2. Open {1}, click Change Field Type and select the type it has in the sources
3. If {1} already has this type, there is nothing to do"

Documentation: https://sfdx-hardis.cloudity.com/salesforce-devops-work-on-user-story-deployment-actions-manual/


Too many fields with history tracking

Detection

  • RegExp: Error (.*) exceeded the allowed number of fields to track

Examples

  • Error Account.Code__c exceeded the allowed number of fields to track on a given entity

Resolution

The object of {1} tracks the history of more fields than allowed (20 per object, 60 with Field Audit Trail).
- Remove <trackHistory>true</trackHistory> from the fields that do not need it
- Fields tracked in the target org but not in your sources count too: untrack them in the target org

Entity is null

Detection

  • String: Entity is null or entity element's name is null

Examples

  • Error Search Entity is null or entity element's name is null

Resolution

An item of the deployment, often the Search Settings, refers to an object that is not in the target org (feature not enabled, or object not deployed yet).
- Deploy the object first, or enable its feature in the target org (Knowledge, Chat...)
- With delta deployments, an item that did not change in the Pull Request is not deployed: change it in the Pull Request, or turn on useDeltaDeploymentWithDependencies (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)
- Or remove the <searchSettingsByObject> block of this object from Search.settings-meta.xml

Custom metadata type not available

Detection

  • RegExp: Error (.*) Custom metadata type "?([^"\s]+)"? is not available in this organization

Examples

  • Error Setting.Default Custom metadata type "Setting__mdt" is not available in this organization

Resolution

Records of {2} are deployed, but the custom metadata type {2} itself is not in the target org.
- Deploy the type (folder objects/{2}): retrieve it from your org with the Metadata Retriever of VS Code, commit it and save your User Story: sfdx-hardis adds it to manifest/package.xml
- With delta deployments, an item that did not change in the Pull Request is not deployed: change it in the Pull Request, or turn on useDeltaDeploymentWithDependencies (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)

Controlling field value not found

Detection

  • RegExp: Error (.*) Control field value (.*) not found, valid values are (.*)

Examples

  • Error Account.Sub_Region__c Control field value EMEA not found, valid values are APAC, AMER

Resolution

Dependent picklist {1} uses the controlling value {2}, which the controlling field does not have in the target org.
- With delta deployments, an item that did not change in the Pull Request is not deployed: change it in the Pull Request, or turn on useDeltaDeploymentWithDependencies (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)
- Or deploy the controlling field (or its StandardValueSet or GlobalValueSet) with value {2} in the same Pull Request
- Or remove the <valueSettings> blocks of {2} from {1}

Global value set of a record type not resolved

Detection

  • RegExp: Error (.*) Global value set (.*) in record type (.*) on the entity (.*) cannot be resolved

Examples

  • Error Account.Partner Global value set Regions in record type Partner on the entity Account cannot be resolved

Resolution

Record type {3} of {4} uses global value set {2}, which is not in the target org.
- Deploy the GlobalValueSet {2}: retrieve it from your org with the Metadata Retriever of VS Code, commit it and save your User Story: sfdx-hardis adds it to manifest/package.xml
- With delta deployments, an item that did not change in the Pull Request is not deployed: change it in the Pull Request, or turn on useDeltaDeploymentWithDependencies (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)
- Or remove the values of {2} from record type {3}

Roll-up summary with dated exchange rates

Detection

  • String: uses dated exchange rates and the other object does not

Examples

  • Error Account.Total_Amount__c One of the objects selected for your roll-up summary uses dated exchange rates and the other object does not

Resolution

With Advanced Currency Management, Salesforce refuses a roll-up summary of a currency field between an object with dated exchange rates (Opportunity...) and one without.
- Compute the total with a Flow or Apex instead of a roll-up summary
- Or disable Advanced Currency Management in the target org, if it is not needed

Layout section not found

Detection

  • RegExp: Error (.*) Couldn't locate layout section: (.*) in layout (.*)

Examples

  • Error Account-Account Layout Couldn't locate layout section: Details in layout Account-Account Layout

Resolution

{1} refers to section {2} of layout {3}, which the target org does not have. With a managed package, the layout name may miss its namespace prefix.
- Check the name of {3}, namespace prefix included, in your sources and in the target org
- Or remove the reference to section {2} from {1}

Highlights panel fields not in the layout

Detection

  • RegExp: Error (.*) Fields in highlights panel must be a subset of fields in detail section

Examples

  • Error Account-Account Layout Fields in highlights panel must be a subset of fields in detail section

Resolution

Layout {1} shows fields in its highlights panel that are not in its sections.
- Add those fields to a section of {1}
- Or remove them from the highlights panel of {1}

Mini layout field not in the layout

Detection

  • RegExp: Error (.*) miniLayoutField: (.*) is not present in the full layout

Examples

  • Error Account-Account Layout miniLayoutField: Code__c is not present in the full layout

Resolution

Layout {1} shows {2} in its mini layout (hover details), but {2} is not in its sections.
- Add {2} to a <layoutSections> block of {1}
- Or remove <fields>{2}</fields> from the <miniLayout> of {1}

Detection

  • RegExp: Error (.*) Cannot use field:WhatId in RelatedContent section

Examples

  • Error Task-Task Layout Cannot use field:WhatId in RelatedContent section.

Resolution

Layout {1} has a related content item on WhatId, often left by an expired package (Health Cloud, Financial Services Cloud).
- Remove the <relatedContentItems> block that uses WhatId from the <relatedContent> section of {1}

Hidden standard button unknown

Detection

  • RegExp: Error (.*) In field: excludeButtons, no such standard action:\s*(\w+)

Examples

  • Error Account-Account Layout In field: excludeButtons, no such standard action:SmartFillEnrich

Resolution

Layout {1} hides the standard button {2}, which does not exist in the target org (its feature is not enabled there).
- Enable the feature that brings {2} in the target org
- Or, to keep it for the orgs that have it, add a replacement rule that removes it before each deployment to the orgs that refuse it (https://sfdx-hardis.cloudity.com/salesforce-devops-config-replacement-rules/):
  sf hardis:project:replacement:create --agent --layer project --id remove-unknown-excluded-button --type xml-remove --files "**/layouts/*.layout-meta.xml" --xml-path "Layout/excludeButtons[.={2}]" --include-branches TARGET_BRANCH
- Or remove <excludeButtons>{2}</excludeButtons> from {1}

Lightning page action not found

Detection

  • RegExp: Error (.*) Component \[force:highlightsPanel\] attribute \[actionNames\]: We couldn't validate Custom Action (\S+)

Examples

  • Error Account_Record_Page Component [force:highlightsPanel] attribute [actionNames]: We couldn't validate Custom Action Account.Send_Invoice

Resolution

Lightning page {1} shows action {2} in its highlights panel, but {2} is not in the target org.
- Deploy the QuickAction {2}: retrieve it from your org with the Metadata Retriever of VS Code, commit it and save your User Story: sfdx-hardis adds it to manifest/package.xml
- With delta deployments, an item that did not change in the Pull Request is not deployed: change it in the Pull Request, or turn on useDeltaDeploymentWithDependencies (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)
- Or remove {2} from the actionNames of the highlights panel in {1}

Lightning page region not used

Detection

  • RegExp: Error (.*) The facet (\S+) is defined by a component in the FlexiPage but not actually used
  • RegExp: Error (.*) Facet (\S+) is not used anywhere in the Lightning page definition

Examples

  • Error Account_Record_Page The facet Facet-1a2b3c is defined by a component in the FlexiPage but not actually used

Resolution

Lightning page {1} holds region {2} that no component uses anymore, often after a merge.
- Remove the <flexiPageRegions> block named {2} from {1}, or put it back in the component property that used it
- Or open {1} in Lightning App Builder in your org, save it, retrieve it again with the Metadata Retriever of VS Code, and commit it

Conditional formatting not found

Detection

  • RegExp: Error (.*) (\S+) isn't a valid value for Conditional Formatting

Examples

  • Error Account_Record_Page Revenue_Colors isn't a valid value for Conditional Formatting.

Resolution

Lightning page {1} uses conditional formatting {2}, defined in a UiFormatSpecificationSet that is not in the target org.
- Deploy the UiFormatSpecificationSet {2} with {1}: retrieve it from your org with the Metadata Retriever of VS Code, commit it and save your User Story: sfdx-hardis adds it to manifest/package.xml
- With delta deployments, an item that did not change in the Pull Request is not deployed: change it in the Pull Request, or turn on useDeltaDeploymentWithDependencies (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)

Invalid cross reference id

Detection

  • RegExp: Error (.*) invalid cross reference id

Examples

  • Error Sales_Console invalid cross reference id

Resolution

{1} refers to an item that is missing in the target org (a profile, a record type, a page...).
- Find the missing item in {1}, and deploy it: retrieve it from your org with the Metadata Retriever of VS Code, commit it and save your User Story: sfdx-hardis adds it to manifest/package.xml
- With delta deployments, an item that did not change in the Pull Request is not deployed: change it in the Pull Request, or turn on useDeltaDeploymentWithDependencies (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)
- For a CustomApplication, deploy the profiles named in its <profileActionOverrides> with it, or remove those blocks

Console workspace mapping tab not defined

Detection

  • RegExp: Error (.*) The (\S+) tab in the workspace mapping is not defined

Examples

  • Error Sales_Console The Invoice__c tab in the workspace mapping is not defined. Include the Invoice__c tab or remove the extra workspace mapping.

Resolution

Console app {1} maps tab {2} in its <workspaceConfig>, but {2} is not one of its tabs.
- Add <tabs>{2}</tabs> to {1}
- Or remove the <mappings> block of {2} from {1}

Duplicate profile action override

Detection

  • String: You specified one or more duplicate ProfileActionOverride values

Examples

  • Error Sales_Console CustomApplication - You specified one or more duplicate ProfileActionOverride values.

Resolution

The application has the same <profileActionOverrides> block twice (same profile, page, form factor and record type), often after a merge.
- Remove the duplicate blocks from the application file

Lightning component module not found

Detection

  • RegExp: Error (.*) No MODULE named markup:\/\/(\S+) found

Examples

  • Error invoiceList No MODULE named markup://c:invoiceRow found

Resolution

Component {1} uses {2}, which is not in the target org.
- Deploy the component {2}: retrieve it from your org with the Metadata Retriever of VS Code, commit it and save your User Story: sfdx-hardis adds it to manifest/package.xml
- With delta deployments, an item that did not change in the Pull Request is not deployed: change it in the Pull Request, or turn on useDeltaDeploymentWithDependencies (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)
- Or fix the import or the tag in {1}, and check the case of the name

Apex action of a Lightning component not found

Detection

  • RegExp: Error (.*) Unable to find Apex action (class|method) referenced as '([^']+)'

Examples

  • Error invoiceList Unable to find Apex action class referenced as 'InvoiceController'.

Resolution

Component {1} calls Apex {2} {3}, which is not in the target org, or is not callable from a component.
- Deploy the Apex class: retrieve it from your org with the Metadata Retriever of VS Code, commit it and save your User Story: sfdx-hardis adds it to manifest/package.xml
- With delta deployments, an item that did not change in the Pull Request is not deployed: change it in the Pull Request, or turn on useDeltaDeploymentWithDependencies (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)
- Check that the method is static and @AuraEnabled, in a public or global class, and the import in {1}: @salesforce/apex/ClassName.methodName

Connected App consumer key can not be written

Detection

  • String: Connected apps must have a unique 'consumerKey'

Examples

  • Error My_Integration Connected apps must have a unique 'consumerKey', and once set this value is not writable.

Resolution

Each org generates the consumer key of its Connected Apps, and a deployment can not overwrite it.
- Remove <consumerKey> from the .connectedApp-meta.xml file
- List the Connected Apps in manifest/package-no-overwrite.xml: CI/CD creates them once, then never overwrites the ones that exist (https://sfdx-hardis.cloudity.com/salesforce-devops-config-overwrite/)

Flow action not found

Detection

  • RegExp: Error (\S+) (.*)We can't find an action with the name and action type that you specified

Examples

  • Error Invoice_Flow Send_Invoice (Action) - We can't find an action with the name and action type that you specified.

Resolution

Flow {1} calls an action (invocable Apex, prompt template, quick action...) that is not in the target org.
- Deploy the called item with the flow: retrieve it from your org with the Metadata Retriever of VS Code, commit it and save your User Story: sfdx-hardis adds it to manifest/package.xml
- With delta deployments, an item that did not change in the Pull Request is not deployed: change it in the Pull Request, or turn on useDeltaDeploymentWithDependencies (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)
- Check that its name and type in the flow match the item

Flow Apex-defined type not valid

Detection

  • String: "apexClass" is invalid. Provide the API name of an Apex class that includes an Apex data type supported in flows

Examples

  • Error Invoice_Flow InvoiceData - "apexClass" is invalid. Provide the API name of an Apex class that includes an Apex data type supported in flows.

Resolution

A variable of the flow uses an Apex-defined type whose class is not in the target org, or has no property the flow can use.
- Deploy the Apex class with the flow: retrieve it from your org with the Metadata Retriever of VS Code, commit it and save your User Story: sfdx-hardis adds it to manifest/package.xml
- With delta deployments, an item that did not change in the Pull Request is not deployed: change it in the Pull Request, or turn on useDeltaDeploymentWithDependencies (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)
- Check that the properties the flow uses are @AuraEnabled, with types supported in flows

Flow definition version not found

Detection

  • RegExp: Error (.*) Invalid version number (\S+)

Examples

  • Error Invoice_Flow Invalid version number 4

Resolution

FlowDefinition {1} activates version {2}, which the target org does not have.
- Deploy the Flow itself (its .flow-meta.xml file), not only its FlowDefinition
- The activation of a flow is its <status>: remove the FlowDefinition from your sources and package.xml

Field referenced by a Flow version

Detection

  • RegExp: Error (.*) This custom field is referenced elsewhere in salesforce.com. : Flow Version - (.*)
  • Replaces: Can not delete custom field

Examples

  • Error Account.Old_Field__c This custom field is referenced elsewhere in salesforce.com. : Flow Version - Account_Update

Resolution

Field {1} is still used by a version of flow {2} in the target org, even an inactive one.
- Remove {1} from the flow in your sources, deploy, then delete the field in a later deployment
- Delete the old versions of {2} that use {1} in the target org (sf hardis:org:purge:flow)

Flow schedule day of month not accepted

Detection

  • String: dayOfMonthToRun invalid at this location in type FlowSchedule
  • Replaces: Error parsing file

Examples

  • Error Invoice_Reminder Error parsing file: Element {http://soap.sforce.com/2006/04/metadata}dayOfMonthToRun invalid at this location in type FlowSchedule

Resolution

The schedule of the flow has <dayOfMonthToRun>, which the API version of the target org does not accept.
- sfdx-hardis removes it before each deployment with the built-in replacement rule builtin-flow-schedule-day-of-month: check it is on in .sfdx-hardis.yml (https://sfdx-hardis.cloudity.com/salesforce-devops-config-replacement-rules-builtin/)
- Once the target org runs the release that accepts it, the rule removes nothing anymore

Flow filter logic references an undefined filter

Detection

  • RegExp: Error (.*) Invalid condition logic: The filter logic references an undefined filter: (\S+)

Examples

  • Error Invoice_Flow Invalid condition logic: The filter logic references an undefined filter: 3

Resolution

In flow {1}, a filter logic (like 1 AND 2) names condition {2}, which does not exist, often after a merge.
- Fix the <filterLogic> or <conditionLogic> of the element, so it only names its existing conditions

Flow screen property not supported

Detection

  • RegExp: Error (\S+) (.*) (\w+) isn't supported for field Type "(\w+)"

Examples

  • Error Invoice_Flow Customer_Name (Screen Component) inputsOnNextNavToAssocScrn isn't supported for field Type "InputField"

Resolution

In flow {1}, a screen component of type {4} has property {3}, which this type does not accept.
- Remove {3} from that screen field in the flow file

Flow translation references a missing element

Detection

  • RegExp: Error (.*) The translation for the (.*) flow references the (.*), which isn't available in the flow

Examples

  • Error fr The translation for the 'Invoice_Flow' flow references the Old_Screen screen, which isn't available in the flow.

Resolution

Translation {1} translates {3}, which flow {2} does not have anymore.
- Remove the block of {3} from the translation files of {2}
- Or retrieve the translations of {2} again with the Metadata Retriever of VS Code, and commit them

Flow Send Email action value missing

Detection

  • RegExp: Error (.*?) (?:Flow Action Error: )?The value in (\S+) is either missing or contains multiple fields

Examples

  • Error Invoice_Flow Flow Action Error: The value in Send_Invoice_Email is either missing or contains multiple fields

Resolution

In flow {1}, an input of the Send Email action {2} needs exactly one value.
- Fix the inputs of {2} in the flow so each one gets a single value

Approval process without step

Detection

  • String: An approval process can't be active until it has at least one approval step

Examples

  • Error Invoice__c.Invoice_Approval An approval process can't be active until it has at least one approval step.

Resolution

The approval process is deployed active without any step, often because its steps changed while it was active.
- Deploy it with <active>false</active>, then activate it in each org after the deployment: the manual deployment action below reminds it, with a checkbox in the Pull Request comments
- To change the steps of an active process, clone it into a new process, and deactivate the old one

Deployment action

A deployment action can solve this error. Create it on the Pull Request of the current branch:

sf hardis:project:action:create --agent --scope pr --pr-id current --when post-deploy --type manual --label "Activate the approval process" --instructions "1. Open Setup, type Approval Processes in the Quick Find box, and open Approval Processes
2. Select the object, then click Activate next to the approval process of the Pull Request
3. If it is already active, there is nothing to do"

Documentation: https://sfdx-hardis.cloudity.com/salesforce-devops-work-on-user-story-deployment-actions-manual/


Approval process steps can not change

Detection

  • String: Once an approval process has been activated, you cannot add or remove steps

Examples

  • Error Invoice__c.Invoice_Approval Once an approval process has been activated, you cannot add or remove steps. Please create a new approval process from this one for modification.

Resolution

An approval process that has been active keeps its steps forever.
- Create a new approval process from this one (Clone in Setup -> Approval Processes) with a new name, and deploy it
- Deactivate the old process in the target org once the new one is active

Approval process with pending records

Detection

  • String: You can't delete this approval process because records were submitted for approval

Examples

  • Error Invoice__c.Invoice_Approval You can't delete this approval process because records were submitted for approval and haven't completed the process

Resolution

Records are still waiting in this approval process in the target org.
- Approve, reject or recall the pending records in the target org, then run the job again
- The manual deployment action below reminds to do it in each org of the pipeline, with a checkbox in the Pull Request comments

Deployment action

A deployment action can solve this error. Create it on the Pull Request of the current branch:

sf hardis:project:action:create --agent --scope pr --pr-id current --when pre-deploy --type manual --label "Close the pending requests of the approval process" --instructions "1. In the target org, open the Items to Approve list, or a report on Process Instances, filtered on this approval process
2. Approve, reject or recall each pending request
3. If no request is pending, there is nothing to do"

Documentation: https://sfdx-hardis.cloudity.com/salesforce-devops-work-on-user-story-deployment-actions-manual/


Approval process previous approver type

Detection

  • String: Replace PreviousApprover with a valid enumeration value

Examples

  • Error Invoice__c.Invoice_Approval The approver null has an invalid type. Replace PreviousApprover with a valid enumeration value

Resolution

A step of the approval process uses the approver type PreviousApprover, which the Metadata API can not deploy.
- Change the <type> of that approver in the approval process file (queue, user, relatedUserField...)
- Or remove it, deploy, then set the approver in each org after the deployment: the manual deployment action below reminds it

Deployment action

A deployment action can solve this error. Create it on the Pull Request of the current branch:

sf hardis:project:action:create --agent --scope pr --pr-id current --when post-deploy --type manual --label "Set the previous approver of the approval process" --instructions "1. Open Setup, type Approval Processes in the Quick Find box, and open the approval process
2. Edit the step, and set its approver to the previous approver
3. If it is already set, there is nothing to do"

Documentation: https://sfdx-hardis.cloudity.com/salesforce-devops-work-on-user-story-deployment-actions-manual/


Can not create an active component

Detection

  • RegExp: Error (.*) You can't create an? (.*) with an active status

Examples

  • Error Invoice_Assignment You can't create a Assignment Rule with an active status.

Resolution

{1} is a new {2}, and Salesforce does not create it already active.
- Deploy {1} inactive first, then activate it in each org after the deployment: the manual deployment action below reminds it
- Next deployments can keep it active, once it exists in the target org

Deployment action

A deployment action can solve this error. Create it on the Pull Request of the current branch:

sf hardis:project:action:create --agent --scope pr --pr-id current --when post-deploy --type manual --label "Activate {2} {1}" --instructions "1. In Setup, open the page of the {2} items, and open {1}
2. Activate it
3. If it is already active, there is nothing to do"

Documentation: https://sfdx-hardis.cloudity.com/salesforce-devops-work-on-user-story-deployment-actions-manual/


No such column on entity

Detection

  • RegExp: Error (.*) No such column '(\w+)' on entity '(\w+)'

Examples

  • Error InvoiceService No such column 'Amount__c' on entity 'Invoice__c'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name.

Resolution

Apex {1} queries field {2} of {3}, which the target org does not have.
- Deploy field {3}.{2}: retrieve it from your org with the Metadata Retriever of VS Code, commit it and save your User Story: sfdx-hardis adds it to manifest/package.xml
- With delta deployments, an item that did not change in the Pull Request is not deployed: change it in the Pull Request, or turn on useDeltaDeploymentWithDependencies (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)
- Check the API name (__c suffix, namespace prefix). If {2} is a standard field, enable its feature in the target org

sObject type not supported

Detection

  • RegExp: Error (.*) sObject type '(\w+)' is not supported

Examples

  • Error InvoiceService sObject type 'Invoice__c' is not supported.

Resolution

Apex {1} uses object {2}, which the target org does not have, or that the deployment user can not access.
- Deploy the object {2}: retrieve it from your org with the Metadata Retriever of VS Code, commit it and save your User Story: sfdx-hardis adds it to manifest/package.xml
- With delta deployments, an item that did not change in the Pull Request is not deployed: change it in the Pull Request, or turn on useDeltaDeploymentWithDependencies (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)
- Check the API name (__c suffix, namespace prefix). If {2} is a standard object, enable its feature in the target org

Method does not exist or incorrect signature

Detection

  • RegExp: Error (.*) Method does not exist or incorrect signature: (.*)

Examples

  • Error InvoiceService Method does not exist or incorrect signature: void send(Invoice__c) from the type InvoiceMailer (12:20)

Resolution

{1} calls {2}, which does not exist with these parameter types in the target org.
- Deploy the new version of the class that holds the method with {1}: With delta deployments, an item that did not change in the Pull Request is not deployed: change it in the Pull Request, or turn on useDeltaDeploymentWithDependencies (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)
- Check the parameter types and the visibility (public, global) of the method

Field is not writeable

Detection

  • RegExp: Error (.*) Field is not writeable: (\S+)

Examples

  • Error InvoiceService Field is not writeable: Invoice__c.Total__c (18:12)

Resolution

{1} assigns {2}, which can not be written: formula, roll-up summary, auto number or system field.
- Remove the assignment of {2}, or write another field
- If {2} became a formula in your sources, deploy the Apex change with it

Experience site not found

Detection

  • RegExp: Error (.*) In field: Site - no CustomSite named (.*) found

Examples

  • Error Partners In field: Site - no CustomSite named Partners1 found

Resolution

{1} refers to site {2}, which is not in the target org.
- Deploy the CustomSite {2} with the Network and the ExperienceBundle (or DigitalExperienceBundle) of the site: retrieve it from your org with the Metadata Retriever of VS Code, commit it and save your User Story: sfdx-hardis adds it to manifest/package.xml
- With delta deployments, an item that did not change in the Pull Request is not deployed: change it in the Pull Request, or turn on useDeltaDeploymentWithDependencies (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)
- Check <urlPathPrefix> of the site: only letters and digits

Experience network not found

Detection

  • RegExp: Error (.*) In field: Network - no Network named (.*) found

Examples

  • Error Partners In field: Network - no Network named Partners found

Resolution

{1} refers to the Experience Cloud site {2}, which is not in the target org.
- Deploy the Network {2} with its CustomSite and ExperienceBundle (or DigitalExperienceBundle): retrieve it from your org with the Metadata Retriever of VS Code, commit it and save your User Story: sfdx-hardis adds it to manifest/package.xml
- With delta deployments, an item that did not change in the Pull Request is not deployed: change it in the Pull Request, or turn on useDeltaDeploymentWithDependencies (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)
- After the first deployment of a site, publish it with a deployment action of type publish-community (https://sfdx-hardis.cloudity.com/salesforce-devops-work-on-user-story-deployment-actions-publish-community/)

Experience site web address must be alphanumeric

Detection

  • String: The Default Web Address must be alphanumeric

Examples

  • Error Partners The Default Web Address must be alphanumeric.

Resolution

The URL of the Experience Cloud site holds other characters than letters and digits.
- Remove the other characters from <urlPathPrefix> in the CustomSite and Network files of the site

Experience site URL path prefix not valid

Detection

  • RegExp: Error (.*) The value for urlPathPrefix in (\w+) isn't valid

Examples

  • Error Partners The value for urlPathPrefix in DigitalExperienceConfig isn't valid. Check the value and try again.

Resolution

The URL path prefix of site {1} in {2} is not accepted by the target org: wrong characters, or already used by another site.
- Use a prefix made of letters and digits, unique in the target org
- If the prefix must differ between orgs, write the value of each org with an xml-value replacement rule (https://sfdx-hardis.cloudity.com/salesforce-devops-config-replacement-rules/)
- If the deployment holds Site.com items (SiteDotCom) of the site, remove them from your sources

ExperienceBundle Metadata API not enabled

Detection

  • RegExp: Error (.*) wasn't deployed because ExperienceBundle isn't enabled for Aura sites

Examples

  • Error Partners1 Partners1 wasn't deployed because ExperienceBundle isn't enabled for Aura sites.

Resolution

The ExperienceBundle Metadata API is not enabled for Aura sites in the target org.
- Enable it in the target org (and in the source org before retrieving): Setup -> Digital Experiences -> Settings -> "Enable ExperienceBundle Metadata API"
- The manual deployment action below reminds to do it in each org of the pipeline, with a checkbox in the Pull Request comments

Deployment action

A deployment action can solve this error. Create it on the Pull Request of the current branch:

sf hardis:project:action:create --agent --scope pr --pr-id current --when pre-deploy --type manual --label "Enable ExperienceBundle Metadata API" --instructions "1. Open Setup, type Digital Experiences in the Quick Find box, and open Settings
2. Check \"Enable ExperienceBundle Metadata API\", then Save
3. If it is already checked, there is nothing to do"

Documentation: https://sfdx-hardis.cloudity.com/salesforce-devops-work-on-user-story-deployment-actions-manual/


Experience site theme not found

Detection

  • RegExp: Error (.*) The currentThemeId property in (\S+) is null or points to a non-theme component

Examples

  • Error Partners1 The currentThemeId property in config/partners.json is null or points to a non-theme component.

Resolution

File {2} of site {1} refers to a theme that is not in the deployment.
- Set currentThemeId in {2} to the id of a theme of the site, from the themes folder of the bundle
- Or retrieve the whole site again with the Metadata Retriever of VS Code, and commit it

Experience navigation menu not found

Detection

  • RegExp: Error (.*) The navigation menu `?([^`]+?)`? doesn't exist

Examples

  • Error Partners1 The navigation menu `Default_Navigation` doesn't exist..

Resolution

Site {1} uses navigation menu {2}, whose developer name is not the same in the target org (navigation menus get a suffix in each org).
- Query NavigationLinkSet in the target org to find the developer name of the menu
- Write the name of each org with a text replacement rule (https://sfdx-hardis.cloudity.com/salesforce-devops-config-replacement-rules/), or deploy the NavigationMenu {2} with the site

Experience component attribute not valid

Detection

  • RegExp: Error (.*) We couldn't validate (\S+) in (\S+\.json) for component (\S+)

Examples

  • Error Partners1 We couldn't validate componentAttributes in views/home.json for component 6c4e5a1b. Error: attribute [navigationMenuEditorRefresh]: invalid value

Resolution

Property {2} of component {4} in {3} is not accepted by the target org, often because it points to an item of the source org (navigation menu, record, page).
- If the value differs between orgs, write the value of each org with a text replacement rule (https://sfdx-hardis.cloudity.com/salesforce-devops-config-replacement-rules/)
- Or remove the line of {2} from {3}, deploy, then set the value again in Experience Builder of each org
- Check that the items the component uses are deployed with the site: With delta deployments, an item that did not change in the Pull Request is not deployed: change it in the Pull Request, or turn on useDeltaDeploymentWithDependencies (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)

Experience component name not valid

Detection

  • RegExp: Error (.*) Component names can only contain alphanumeric characters, hyphens, colons, and underscores. Correct label in (\S+) and try again

Examples

  • Error Partners1 Component names can only contain alphanumeric characters, hyphens, colons, and underscores. Correct label in views/home.json and try again.

Resolution

A component label in {2} of site {1} holds characters a component name does not accept.
- Fix the label in {2}: letters, digits, hyphens, colons and underscores only

Experience translation of a missing component

Detection

  • RegExp: Error (.*) The component (\S+) can't be included in the translation variant because it doesn't exist in the primary content

Examples

  • Error Partners1 The component 6c4e5a1b can't be included in the translation variant because it doesn't exist in the primary content.

Resolution

A translation of site {1} holds component {2}, which the page itself does not have anymore.
- Remove the entry of {2} from the translation file of the page, then deploy again

Agent type can not be updated

Detection

  • RegExp: Error (.*) BotType can't be updated

Examples

  • Error Customer_Agent BotType can't be updated

Resolution

Agent {1} is already in the target org with another type, or its committed version is deployed again.
- Deploy a new version of the agent instead of overwriting the committed one
- See https://sfdx-hardis.cloudity.com/salesforce-ci-cd-agentforce-agents/

Not available for deploy for this API version

Detection

  • RegExp: Error (.*) Not available for deploy for this API version

Examples

  • Error Customer_Agent Not available for deploy for this API version

Resolution

{1} has a metadata type that this API version can not deploy anymore (for example GenAiPlanner, replaced by GenAiPlannerBundle from API 64).
- Retrieve {1} again with the Metadata Retriever of VS Code, with its new type, and remove the files of the old type: saving your User Story updates manifest/package.xml
- Agentforce agents: see https://sfdx-hardis.cloudity.com/salesforce-ci-cd-agentforce-agents/

Prompt template data provider not accessible

Detection

  • String: Data provider id is not accessible

Examples

  • Error Invoice_Summary Failure to create template: 0hfAa000000AbCd, Caused by: [We couldn't validate the prompt template because something went wrong. Error while executing the following data provider. Data provider id is not accessible]

Resolution

The prompt template uses a data provider (Flow, Apex, related list...) that the target org does not have, or that the deployment user can not run.
- Deploy the Flow or the Apex class of the data provider with the prompt template: retrieve it from your org with the Metadata Retriever of VS Code, commit it and save your User Story: sfdx-hardis adds it to manifest/package.xml
- With delta deployments, an item that did not change in the Pull Request is not deployed: change it in the Pull Request, or turn on useDeltaDeploymentWithDependencies (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)
- Give the user of the CI/CD deployments access to it

Standard object translation can not be deleted

Detection

  • RegExp: Error (.*) The CustomObjectTranslation called (.*) is standard and cannot be deleted

Examples

  • Error Account-fr The CustomObjectTranslation called Account-fr is standard and cannot be deleted

Resolution

The translation {2} of a standard object can not be deleted.
- Remove {2} from destructiveChanges.xml
- To stop translating it, disable the language in the Translation Workbench of the target org

Salesforce internal error

Detection

  • String: An unexpected error occurred. Please include this ErrorId
  • Applies to: component errors, deployment errors

Examples

  • UNKNOWN_EXCEPTION: An unexpected error occurred. Please include this ErrorId if you contact support: 1234567890-12345 (-1234567890)

Resolution

Salesforce failed internally: the message does not say what is wrong.
- Run the job again, it is sometimes temporary
- Find the item that causes it: with delta deployments, the deployment holds only the items of the Pull Request (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)
- If it goes on, open a Salesforce support case with the ErrorId

Another deployment is in progress

Detection

  • String: ALREADY_IN_PROCESS
  • Applies to: deployment errors

Examples

  • Deployment failed (ALREADY_IN_PROCESS)

Resolution

Another deployment or setup change is running in the target org, often the deployment simulation of an older job of the same Pull Request.
- Wait for it to finish (Setup -> Deployment Status), then run the job again
- Call sf hardis:project:deploy:cancel from the cancellation hook of your CI jobs: when a new commit cancels a job, its deployment simulation is cancelled in the org too (https://sfdx-hardis.cloudity.com/hardis/project/deploy/cancel/)

Deployment too large

Detection

  • String: Maximum size of request reached
  • String: 52428800 bytes
  • Applies to: deployment errors

Examples

  • Maximum size of request reached. Maximum size of request is 52428800 bytes.

Resolution

The deployment is larger than what the Metadata API accepts (about 39 MB zipped). Without delta deployments, each job deploys the full content of manifest/package.xml.
- Turn on delta deployments (useDeltaDeployment: true), so a Pull Request deploys only its own items (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)
- List the large items that are maintained in the org, or never change (static resources, documents, reports...), in manifest/package-no-overwrite.xml: CI/CD deploys them only once (https://sfdx-hardis.cloudity.com/salesforce-devops-config-overwrite/)
- Check that .forceignore excludes the files that must not be deployed

Deployment retry limit exceeded

Detection

  • String: Your deployment exceeded its maximum retry limit
  • Applies to: deployment errors

Examples

  • LIMIT_EXCEEDED: Try deploying again. Your deployment exceeded its maximum retry limit. If you keep seeing this error, please contact Salesforce Customer Support.

Resolution

Several deployments or validations ran against the target org at the same time.
- Run them one after the other, then run the job again
- Call sf hardis:project:deploy:cancel from the cancellation hook of your CI jobs, so a cancelled job does not leave its deployment simulation running (https://sfdx-hardis.cloudity.com/hardis/project/deploy/cancel/)

NoTestRun not allowed in production

Detection

  • String: testLevel of NoTestRun cannot be used in production organizations
  • Applies to: deployment errors

Examples

  • INVALID_OPERATION: testLevel of NoTestRun cannot be used in production organizations

Resolution

A deployment to a production org always runs Apex tests.
- Remove testLevel NoTestRun from the config of the production branch (config/branches/.sfdx-hardis.<branch>.yml): sfdx-hardis uses RunLocalTests by default

Invalid session id

Detection

  • String: INVALID_SESSION_ID
  • Applies to: component errors, deployment errors

Examples

  • INVALID_SESSION_ID: Session expired or invalid

Resolution

The session to the target org expired or was revoked.
- Locally, run "Select another org" from the Status panel of VS Code (or sf hardis:org:select)
- In CI/CD, configure the authentication of the branch again with sf hardis:project:configure:auth, and check that the deployment user is still active

Test failure: mixed DML operation

Detection

  • String: MIXED_DML_OPERATION
  • Applies to: Apex test failures

Examples

  • System.DmlException: Insert failed. First exception on row 0; first error: MIXED_DML_OPERATION, DML operation on setup object is not permitted after you have updated a non-setup object (or vice versa): User, original object: Account: []

Resolution

The test inserts or updates a setup object (User, Group, PermissionSetAssignment...) and another object in the same transaction.
- Wrap the DML of the setup objects in System.runAs(new User(Id = UserInfo.getUserId())) { ... }
- Or create them in a @TestSetup method

Test failure: unable to lock row

Detection

  • String: UNABLE_TO_LOCK_ROW
  • Applies to: Apex test failures

Examples

  • System.DmlException: Update failed. First exception on row 0 with id 001Aa000000AbCdEFG; first error: UNABLE_TO_LOCK_ROW, unable to obtain exclusive access to this record: []

Resolution

Another test or job updated the same record at the same time.
- Mark the test class with @isTest(isParallel=false), or disable parallel Apex testing in the target org (Setup -> Apex Test Execution -> Options)
- Create the test data in each test, instead of using existing records

Test failure: too many SOQL queries

Detection

  • String: Too many SOQL queries: 101
  • Applies to: Apex test failures

Examples

  • System.LimitException: Too many SOQL queries: 101

Resolution

The tested code runs more than 100 SOQL queries in one transaction, usually a query inside a loop, or a trigger that runs again and again.
- Move the queries out of the loops, and query once for all the records
- Stop the recursion of triggers with a static flag
- In the test, call the tested code between Test.startTest() and Test.stopTest() to get fresh limits

Test failure: validation rule

Detection

  • RegExp: FIELD_CUSTOM_VALIDATION_EXCEPTION, ([^:\n]*)
  • Applies to: Apex test failures

Examples

  • System.DmlException: Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Invoice date is required: [Invoice_Date__c]

Resolution

A validation rule of the target org refuses the test data: {1}
- Fill the test data so it passes the validation rule
- Create the test data with a test data factory shared by the test classes, so one fix covers them all
- Run the test class on your org before publishing: sf hardis:org:test:apex

Test failure: required field missing

Detection

  • RegExp: REQUIRED_FIELD_MISSING, Required fields are missing: \[([^\]]*)\]
  • Applies to: Apex test failures

Examples

  • System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [Invoice_Date__c]: [Invoice_Date__c]

Resolution

The test data misses fields required in the target org: {1}
- Set {1} in the test data
- Run the test class on your org before publishing: sf hardis:org:test:apex

Test failure: duplicates detected

Detection

  • String: DUPLICATES_DETECTED
  • Applies to: Apex test failures

Examples

  • System.DmlException: Insert failed. First exception on row 0; first error: DUPLICATES_DETECTED, Use one of these records?: []

Resolution

A duplicate rule of the target org blocks the test data.
- Make the test data unique (names, emails, phone numbers...)
- Or insert it with Database.DMLOptions, with DuplicateRuleHeader.allowSave = true

Test failure: flow error

Detection

  • String: CANNOT_EXECUTE_FLOW_TRIGGER
  • Applies to: Apex test failures

Examples

  • System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_EXECUTE_FLOW_TRIGGER, We can't save this record because the "Invoice Update" process failed. Give your Salesforce admin these details.

Resolution

A flow of the target org failed on the test data. The rest of the message names the flow and its error.
- Fix the test data so the flow can run, or fix the flow
- Check that the flow and the fields it uses are deployed with the test

XML item appears more than once

Detection

  • RegExp: Error (.*) Field:(.*), value:(.*) appears more than once

Examples

  • Error Account.Status__c Field:Name, value:Closed appears more than once

Resolution

You probably made an error while merging conflicts
Look for {3} in the XML of {1}
If you see two {2} XML blocks with {3}, please decide which one you keep and remove the other one

Comments