Salesforce is a configurable platform that allows you to configure custom fields, rules, and workflows. Unfortunately, those custom configurations can sometimes cause errors that will make the integration fail. Below are some common errors you may see and some solutions for each so that you can troubleshoot your Salesforce integration with confidence.
INVALID_SESSION_ID
This error typically means that the access token used to connect to the app has expired. If an application uses an expired access token, you'll see this error. The web server OAuth authentication flow and user-agent flow both provide a refresh token that can be used to obtain a new access token. Access tokens have a limited session length that is specified by the session timeout in Salesforce.
To fix this error, you can reauthorize the Salesforce integration. You will need to log out of Salesforce in your browser before reauthorizing the integration in CallRail.
For more information, you can reference this Salesforce support article: Authorization Through Connected Apps and OAuth 2.0.
API_DISABLED_FOR_ORG
If you receive this error, your organization may not have access or may not have enabled the REST API in your Salesforce account. Salesforce Enterprise, Unlimited, and Developer editions have the API enabled by default. Professional Customers can purchase this feature.
INVALID_TYPE: sObject type 'Profile' is not supported
If you receive this error, it is because you've authorized the integration with a user that has a Salesforce API Integration User license or as a Customer Portal or Partner Portal user. Our integration requires access to Profiles in Salesforce. The license and user types mentioned above do not get access to Profiles and cannot be used with the integration.
If you did authorize the integration with one of the above user types, you'll want to ensure the 'View All Profiles' option is enabled for the Profile associated with the authorizing user:
If it is unchecked, you will receive this error and will be unable to integrate. You can update this setting as described in this Salesforce support article: Update User Profiles
LEAD_SOURCE_PICKLIST_ERROR
If you see this, it means an error occurred while trying to retrieve values from the Source picklist on the Lead object. The cause of this error could be a misconfiguration or lack of proper access for the user that authorized the integration.
CANNOT_UPDATE_CONVERTED_LEAD
Restforce::ErrorCode::CannotUpdateConvertedLead: CANNOT_UPDATE_CONVERTED_LEAD: cannot reference converted lead
This means we are trying to update a Lead that we previously stored an ID for, but it has since been converted to an Opportunity or Account.
If you see this, you have three options for resolution. Your first option is to enable the 'View and Edit Converted Leads' setting on the Profile associated with the user who authorized the integration:
This allows the integration to function even after leads are converted. As noted in this Salesforce article on the subject, this setting may not be available in all organizations.
Another option is to wait until all integration data has posted before converting the Lead to another object. This typically occurs no more than 25 minutes after the call hangs up, depending on recording, transcription, and Conversation Intelligence settings.
The last option to avoid this error is to change the integration's setting to "Only send call data when a call is completed." This will only send one API call after the call ends. This single API call will include all details about the call. This will mean that users will not be able to interact with the Lead record while on the call, but you will avoid the error altogether.
DUPLICATES_DETECTED
This error is triggered by a duplicate rule that is active in Salesforce and has the "Alert" option turned on. This means that anytime CallRail creates a Lead in Salesforce and a matching Lead is detected, this rule will cause an "alert" to occur and effectively halts the Lead creation.
To resolve this, first identify the duplicate rule that is causing the issue. Then, you can choose to delete the "Alert" option, change the rule, and/or add conditions that will prevent the rule from applying to Leads created by the integration.
There is an error with your Salesforce authentication
If you see this, the integration needs to be reauthorized. You will need to log out of Salesforce in your browser before reauthorizing the integration in CallRail.
This can also happen when you exceed the number of authorizations allowed for your user. Salesforce only allows each user to authorize four third-party applications (measured by the number of tokens, so four tokens). If you authorize five Salesforce integrations in CallRail (or four in CallRail and one in another application) with the same Salesforce user, one of those integrations will fail and this error will appear.
As a workaround, you can create an additional Salesforce user to authorize integrations. Make sure the integrations are limited to no more than four per Salesforce user.
Restforce::ErrorCode::UnknownException
We can't save this record because the "{Process Name}" process failed. Give your Salesforce admin these details. An error occurred when executing a flow interview.
CANNOT_EXECUTE_FLOW_TRIGGER
This error occurred when the flow tried to update records: CANNOT_EXECUTE_FLOW_TRIGGER: We can't save this record because the “{Process Name}” process failed. Give your Salesforce admin these details.
These errors often mean that there is a custom workflow configured within Salesforce that can’t run for whatever object it’s related to. A common cause is that a field value the workflow relies on is not present in the Lead and/or Activity record we created. This can occur if the field is not mapped or is mapped to something that doesn’t always have a value. Your Salesforce administrator should be able to determine what is preventing the workflow from running successfully.
STORAGE_LIMIT_EXCEEDED
Restforce::ErrorCode::StorageLimitExceeded: STORAGE_LIMIT_EXCEEDED: storage limit exceeded
This means your Salesforce instance has exceeded its storage limit for either uploaded files or data in custom objects and fields.
REQUIRED_FIELD_MISSING
Restforce::ErrorCode::RequiredFieldMissing: REQUIRED_FIELD_MISSING: Required fields are missing: [custom field name]
This means there is a custom field in your Lead or Activity that is marked as Required, but does not have a value in the record we created. This can happen if the field is not mapped or is mapped to something that doesn’t always have a value.
INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY
Restforce::ErrorCode::InsufficientAccessOnCrossReferenceEntity: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY: insufficient access rights on object id
INVALID_CROSS_REFERENCE_KEY
This error occurred when the flow tried to create records: INVALID_CROSS_REFERENCE_KEY: Task Record Type ID: this ID value isn't valid for the user: {User ID}.
These errors mean the user who authorized the integration does not have access to the record that we are trying to update. You can either update the user’s access or have a user with the correct access reauthorize the integration.
STRING_TOO_LONG
STRING_TOO_LONG: {field name}: data value too large: {field data} (max length=255)
This error occurs when the value we are trying to pass for the listed field exceeds the maximum length. To fix this, update the field’s maximum length. If the field length is already at the maximum length, you may need to change the field type.
FIELD_CUSTOM_VALIDATION_EXCEPTION
FIELD_CUSTOM_VALIDATION_EXCEPTION: {some text}
This error often means a required or conditionally required field isn’t set, or that some combination of fields aren’t set to the right values (i.e., Field A can’t have a value of 1 if Field B has a value of 1). You will need to either edit or remove your custom validation in Salesforce, or adjust your field mapping in the CallRail/Salesforce integration accordingly.
JSON_PARSER_ERROR
JSON_PARSER_ERROR: Cannot deserialize instance of {field type} from VALUE_STRING value {field value} or request may be missing a required field.: Cannot deserialize instance of {field type} from VALUE_STRING value {field value} or request may be missing a required field.
This error means the record that we are trying to update is missing a required field. This can happen when the field is not mapped or it is mapped to something that doesn’t always have a value.
FIELD_INTEGRITY_EXCEPTION
FIELD_INTEGRITY_EXCEPTION: There's a problem with this state, even though it may appear correct. Please select a state from the list of valid states.: State/Province
This can happen when Salesforce State picklists are enabled and the State field from CallRail contains a value that is not compatible with the Salesforce picklists. We offer two different fields for short and long form State values: full_customer_state and abbr_customer_state. This error can be resolved by switching your mapping to whichever map form your picklist is expecting.
CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY
CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY: The formula in the "{process name}" rule or process is invalid due to the following: Could not access the following field: {field name}. Contact your administrator.
This error occurs when the update we are trying to make (posting a Lead or an Activity) cannot be completed because a custom rule or process applied to that object cannot run due to a missing dependent field.
Common explanations:
- The user who authorized the integration does not have access to the field (the one in the {field name} part of the error). In that case, make sure that the user has edit access to that field.
- The field no longer exists or has been renamed. To fix this, update the rule to remove or reselect the field.
- If the field with the error is some form of Address, you will need to reference the specific address field (address line 1 / 2 / city / state / zip, etc.) instead of just the generic “address”.