Error overview
You may run into this Salesforce validation error when deploying a QuickAction (Quick action) metadata type.
In Gearset the error message would be reported as below:
Required fields are missing: [Component]
The error is most commonly reported on the QuickAction metadata type. We've also seen it reported once on the Flow metadata type, during a back propagatio PR in Gearset Pipelines.
The guidance in this article focuses on QuickAction, and the Flow case is covered briefly in the Resolution section.
Explanation of the error
Based on our understanding, Salesforce is reporting that it can't resolve what the Quick action is supposed to launch in the target org.
A custom Quick action stores its target (a Flow, a Lightning web component, an Aura component or a Visualforce page) in a field that Salesforce calls Component.
In the Quick action's XML file, this field maps to one of the elements below, depending on the action's <type>:
<flowDefinition>for<type>Flow</type><lightningWebComponent>for<type>LightningWebComponent</type><lightningComponent>for<type>LightningComponent</type><page>for<type>VisualforcePage</type>
An example of a Quick action that launches a Flow:
<QuickAction xmlns="http://soap.sforce.com/2006/04/metadata"> <flowDefinition>Generate_Document_Flow</flowDefinition> <label>Generate Document</label> <optionsCreateFeedItem>false</optionsCreateFeedItem> <type>Flow</type> </QuickAction> |
When validation runs and the referenced Flow or component resolves to nothing in the target org, Salesforce reports the required Component field as missing.
Usually, this isn't the case of an incorrectly formatted XML file. The problem is that the Quick action points to something that isn't usable in the target org at the time of the validation.
In the cases we've seen, this happened when:
The referenced Flow, Lightning web component, Aura component or Visualforce page doesn't exist in the target org, and it isn't included in the deployment package.
The referenced component is included in the deployment package, but it failed to validate itself. In this case the Quick action fails the validation as a knock-on effect, and you'll usually see a separate error on the referenced component in the same validation results.
The metadata type of the referenced component (for example Flow) isn't selected in the metadata filter of the comparison or CI job, so it can't be added to the deployment package.
Note: If several Quick actions fail with this error in the same validation, check whether they all reference the same Flow or another component. Deploying that one missing item to the target org can resolve all of the errors at once.
Resolution
How to find the component that the Quick action depends on, and how to resolve the error depends on how you're making your deployment in Gearset.
However, before we move to the resolution steps it's worth going through below steps to ensure you have all the required information that will help you resolve the error.
Find what the Quick action references
Open the comparison for your failed validation and select the
QuickActionmetadata component named in the error.Switch to the XML view of the component and find its
<type>element, then the matching<flowDefinition>,<lightningWebComponent>,<lightningComponent>or<page>element. Its value is the API name of the component the Quick action launches.Check if that component exists in the target org. For a Flow, also check that the Flow version you need is active.
If the component is missing from the target org, it needs to be deployed either together with the Quick action, or before you attempt to validate the package where Quick action is present.
If the component is part of the same deployment and has its own validation error, resolve that error first. The Quick action error should then clear on the next validation.
Workaround for failed PR validation in Gearset Pipeline
To resolve the error when a PR in your Gearset Pipeline fails the validation:
Check the metadata filter of the CI job for the target environment. Make sure it includes the metadata type of the referenced component: Flow, Lightning Web Component Bundle, Aura Component Bundle or Visualforce page. If the type isn't selected, the referenced component can't be part of the validation even if it's committed to the branch.
Add the referenced component to the feature branch from which your PR was created. In your Gearset Pipeline, you can do it by selecting the Dev Sandbox from which the feature was created, and then selecting
Commit more changes...option.
Note: Make sure to commit changes to the correct feature branch.Alternatively, deploy the referenced component to the target environment first as part of a separate PR.
Once the fix is committed or deployed, re-validate the existing PR in your pipeline.
Temporary workaround: If the Quick action isn't needed in this deployment, you can exclude it from the CI job's metadata filter to unblock the PR. Keep in mind that changes to the excluded Quick action won't be deployed until you add it back to the filter.
Guidelines on how to add more changes to an existing feature branch can be found in this article: Promoting your first features.
Workaround for deployments made via Compare and deploy
These troubleshooting steps are mainly for scenarios where you're not working with Gearset Pipelines.
Does the error happen when running a validation via Compare and deploy (e.g. Git to org, or org to org)?
For Git to org deployments
Use Compare and deploy to commit the referenced Flow or component from your source org into the branch you're deploying from.
Make sure your comparison's metadata filter includes the referenced component's metadata type, then refresh the comparison.
Select the referenced component together with the Quick action, and validate against the target org again.
For org to org deployments
Make sure your metadata filter includes both the
QuickActionmetadata type and the metadata type of the referenced component (for example Flow), then refresh the comparison.Add the referenced component to the deployment package alongside the Quick action. Gearset's missing dependencies problem analyzer can suggest it for you once the metadata type has been retrieved.
Validate the deployment again.
If the error is reported on Flow metadata type
In a single case we've investigated, the error surfaced on a Flow while merging a Dev Sandbox Update into a Dev environment in Gearset Pipeline.
To troubleshoot the issue, follow these steps:
Compare the Flow named in the error between the PR's branch and the target org, and look at the differences in the XML view.
Look for elements (for example a screen component or an action) that reference a component or parameter that's missing, or is incomplete, in the version being deployed.
If there are several Dev Sandbox Updates pending against the same environment, merge them one by one starting from the oldest update. Older PRs may contain changes that more recent updates depend on.
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.

