The REQUIRED_FIELD_MISSING error can happen during a data deployment if the object that you’re deploying includes a required lookup field and you’ve chosen to exclude the object referenced by that field.

What causes the error?

Lookup fields on a Salesforce object are frequently used to associate two records together in a relationship. If the lookup field is also a required field, it must have a value before a record can be saved. A custom lookup field is typically made a universally required field via a checkbox from the Salesforce UI as shown below:

Gearset will not deploy the records from an object with a required lookup field if you have excluded the object referenced by the lookup field. The error is commonly triggered if you attempt to deploy a detail object in a master-detail relationship while excluding the corresponding master object in the deployment.

How do I fix the error?

The main way of avoiding this error is to make sure that you include the relevant dependencies in your deployment. Gearset’s data loader asks you which related objects you want to include in the deployment after you have selected the initial objects that you want to deploy. In the screenshot below, the objects listed under Step 1 on the left side of the screen are the objects already selected by you. The objects listed under Step 2 on the right side of the screen are all the objects in the dependency hierarchy (i.e. a recursive list of the dependencies of the dependencies) referenced by the objects on the left. Include the object referenced by the required field for Gearset to deploy the record to your target.

Alternatively, for the purpose of the deployment, you may choose to filter and exclude the record(s) that give rise to the error.

Did this answer your question?