What’s the Issue?
You may encounter the following error during a deployment:
Error Message:
"Cannot create or modify a field with unknown type"
Detailed Message:
"You cannot create or modify the field \`${field.name}\` of type ‘unknown’.
In Salto, fields are set with an unknown type in case the credentials used for fetch provides limited access rights to that field in Salesforce.
Check your profile permissions on Salesforce to make sure you have access to the field."
What Triggers This Error?
This error is triggered during deployment when Salto attempts to create or modify a field that has been assigned an "unknown" type. This typically occurs when the credentials used to fetch data from Salesforce have limited access rights, preventing Salto from fully identifying the field type.
How Can I Solve This?
To resolve this error, you need to ensure that your Salesforce credentials have sufficient permissions to access the field in question. Here are the steps to solve this issue:
Check Your Profile Permissions in Salesforce:
Navigate to Salesforce and log in with the credentials used for the Salto fetch.
Go to the **Profile** settings associated with these credentials.
Verify that the profile has the necessary permissions to view and modify the field causing the error.
If the permissions are insufficient, you may need to update the profile or use credentials with higher access levels.
Re-fetch the Data in Salto:
After adjusting the permissions, perform a new fetch in Salto to ensure that the field type is correctly identified. If needed, go back to the element selection phase and click "Preview Deployment" again.
If the fetch is successful and the field type is recognized, proceed with your deployment.
Modify the Deployment Plan (If Necessary):
If re-fetching doesn't resolve the issue or if you need to proceed without modifying permissions, you may consider adjusting your deployment plan.
Exclude the problematic field from the deployment or manually edit the field in Salto to reflect the correct type based on your knowledge of the field's intended use.