Skip to main content
All CollectionsTroubleshootingSalesforce validation errors
Resolving validation errors - Once an approval process has been activated, you cannot add or remove steps. Please create a new approval process from this one for modification. You may only delete an approval process that has no data records associated..."
Resolving validation errors - Once an approval process has been activated, you cannot add or remove steps. Please create a new approval process from this one for modification. You may only delete an approval process that has no data records associated..."

Guidance on how to resolve this Salesforce validation error when it happens specifically on a PR validation in Gearset Pipelines feature

Mateusz Kochanowicz avatar
Written by Mateusz Kochanowicz
Updated over 2 months ago

Explanation of the error in the context of PR promotion in Gearset Pipelines

Sometimes, when you promote a new PR in Gearset Pipelines, you may come across a validation error related to an ApprovalProcess metadata:
โ€‹
"Once an approval process has been activated, you cannot add or remove steps. Please create a new approval process from this one for modification. You may only delete an approval process that has no data records associated with it."

An example of a failed PR validation with this error message:

This error message can be confusing if:

  • You've not added any ApprovalProcess metadata components to your Pull Request. And you're not trying to promote them downstream through your Pipeline.

  • Or when ApprovalProcess metadata failing validation are changes that another team member has been working, therefore it is not your intention (nor your job) to promote them with your PR.

So why do you see this validation error?

Your final deployment package (built by the CI job) is based on the items you include in your PR as well as any differences between the source branch (also referred to as: long-lived or environment branch) and the target org of the CI job.
โ€‹
So essentially your final deployment package may include an ApprovalProcess metadata components, which you didn't originally add to your PR.

This would usually happen when:

  • Approval process metadata is included in the filter of the CI job

  • ApprovalProcess metadata component(s) are present in the source branch, and haven't been deployed to the target org (yet). Therefore, CI job may be including ApprovalProcess in your CI deployment package.

Resolution for the PR validation failure

If you're not trying to promote any ApprovalProcess metadata components in your PR - the quickest fix may be to simply remove Approval process from the metadata filter of your CI job.

And once the CI filter is amended, try to promote the PR again in your Gearset Pipeline.

Note: You can apply this workaround temporarily - so only for the purpose of promoting your PR(s). Once they're promoted, you can edit CI job settings again to include Approval process metadata in the filter.

This way you make sure that you're not going to affect any other team members' deployments.

How to amend your CI job settings?

On your CI dashboard, click on the CI job corresponding to the static (green) environment to which you're trying to promote your PR. Then select Edit settings.

Navigate to Metadata filters tab (menu on the left) and make sure to unselect Approval process from your metadata filter. Then select Save (bottom right corner).

Does your validation fail during a deployment made via Compare and deploy?

If you encounter this Salesforce validation error during a validation run via manual Compare and deploy feature (for example during an org to org, or Git to org validation), try to exclude Approval process from your metadata filter.

If for any reason you are not able to apply this workaround because your intention is to deploy changes to the ApprovalProcess metadata, let us know in the in-app chat - we'll do our best to help.

Disclaimer: This error is returned by Salesforce directly, rather than Gearset. Even so, we offer guidance based on our combined experience with the Metadata API. Where possible, we try to help guide you to fix or avoid this error. In the case that this isn't possible, we may need to direct you to Salesforce support for further clarification.

Did this answer your question?