Data records were not fetched

What this warning means and how to resolve it

Support avatar
Written by Support
Updated over a week ago

When fetching a Salto environment that has CPQ or configuration data enabled, you may receive a warning similar to the following:

Your Salto environment is configured to manage records of the Product2 object.
โ€‹
17 Product2 records were not fetched because they have a lookup relationship to one of the following objects:

Product_Master__c

Inventory__c

And these objects are not part of your Salto configuration.

Here are the records: ...

As the error explains, this happens when the objects you have configured to manage by Salto have lookup relationships to other objects that are not managed by Salto.

In the example above, Product2 is configured to be managed by Salto, but Product_Master__c is not.

The default behavior is to not fetch these records (i.e not fetch the Product2 records) and show you the above warning. The exception to this rule is relationships to the User object. For example, If your Product2 records have relationship fields to the User object, we still fetch the Product2 records and show the User ID in plain text.

You can override this behavior so that Salto still fetches the records. There are 3 behaviors you can specify, and they are all under the data object of your Salto configuration

brokenOutgoingReferencesSettings = {
defaultBehavior = "BrokenReference"
perTargetTypeOverrides = {
User = "InternalId"
}
}

The defaultBehaviour specifies what Salto should do when this scenario happens, but you can also specify a per-object override using the perTargetTypeOverrides object.

Broken reference

The first method is to tell Salto to treat the relationship as a broken reference, using the following

brokenOutgoingReferencesSettings = {
defaultBehavior = "BrokenReference"

}

With this configuration, your Product2 records will be fetched, but you will see a specific warning telling you they point to a record that is not in the Salto environment. You will also see a warning if you attempt to deploy these records to another environment.

Internal Id

With this method, the Id of the Product_Master__c record will simply be shown as a text field in Salto. Here's the configuration for this method

brokenOutgoingReferencesSettings = {
defaultBehavior = "InternalId"

}

ExcludeInstance

Finally, you can configure Salto not to fetch the instance, which is the default behavior as explained earlier

brokenOutgoingReferencesSettings = {
defaultBehavior = "ExcludeInstance"

}

Per object override

You can also specify an override for a specific object. For example

brokenOutgoingReferencesSettings = {
defaultBehavior = "BrokenReference"
perTargetTypeOverrides = {
User = "InternalId"
}
}

Notice that the object is the target object, i.e the object in the lookup relationship. In the above example, any reference to a record not managed by Salto will result in a broken reference, except if the referenced record is a User, in that case, we will show the ID in plain text. You can add multiple object overrides, like this:

brokenOutgoingReferencesSettings = {
defaultBehavior = "BrokenReference"
perTargetTypeOverrides = {
User = "InternalId"
Account = "ExcludeInstance"
}
}

Additional options

The options above are all about deciding what to do when a record points to a record not managed by Salto, but another valid option is to configure Salto to actually manage those records too. If that's what you want to do, you must include those objects in your Salto data configuration:

You can include the objects in either of 2 places

includeObjects

This will include all records of this object, which will enable the original records to be fetched along with their references to the newly added record.

allowReferenceTo

This will allow references to these objects, even if those objects are not included in the includeObjects list.

Did this answer your question?