---
title: "Troubleshooting DataSync for Salesforce"
canonical: "https://docs.perspectium.com/space/Lithium/2326748/Troubleshooting%20DataSync%20for%20Salesforce"
format: markdown
---
General Issues When  configuring your Perspectium Properties  for Salesforce, you may run into an issue where you are unable to save your properties. There are various possibilities that may be causing this issue. Refer to the potential solutions below:  Check your credentials  Ensure that your password is correct for the user being used.  Ensure that the entered security token belongs to the user being used.  Check your Consumer Key and/or Consumer Secret Ensure that the Salesforce Consumer Key and/or Salesforce Consumer Secret you are inputting do not contain white spaces. It is recommended to paste your keys to a text editor to ensure there are no white space.  OAuth Endpoint  OAuth Endpoint may vary depending on your environment. Here are the three OAuth Endpoints to try:  https://login.salesforce.com/services/oauth2/token https://<YOUR_SALESFORCE_ORG_HERE>. salesforce.com/services/oauth2/token  (i.e.,  https://na112.salesforce.com/services/oauth2/token) https://test.salesforce.com/services/oauth2/token  (ONLY for Sandbox org)  Whitelist IP range After modifying a Salesforce Apex trigger, there are several points you should check to ensure that data will be shared out of Salesforce properly: When creating a new dynamic share and selecting  Save Trigger , you may get the following error: This happens because Salesforce doesn't allow you to create triggers on every  table (SObject) . For these tables, you will want to use the bulk share option instead. A workaround to this issue is to leave the  Description  field blank when you create a  Perspectium Job . Doing so will populate the  Description  field with the last scheduled run time.  DataSync Agent If you start the DataSync Agent or when the Agent tries to connect to your Salesforce org to obtain the schema for a Salesforce object (table) and you see  400 reason: {"error":"invalid_grant","error_description":"authentication failure"} , update your Perspectium DataSync  connected app  to  Relax IP restrictions  for the  IP Relaxation  setting. To change this setting: Go to  Setup   > Manage Apps > Connected Apps Click on the arrow to the right of the Perspectium DataSync connected app and choose the  Manage  option Select to  Edit Policies Choose the  Relax IP restrictions  option in the dropdown for the  IP Relaxation  setting. Save your changes FAQs If the number of Apex jobs scheduled in your Salesforce org exceeds the maximum number of allowed jobs, then those additional jobs that exceed the maximum will not run. The default value for the max Apex jobs in your Salesforce org is set to 5. This value is set in order to prevent Apex jobs from impacting the overall performance of your org. To change your max number of Apex jobs, navigate to Setup > Custom Settings > Manage ReplicatorJobSettings > Edit.  Go to the  Properties  tab and in the top right corner of the page you will see the version of Perspectium DataSync application you are running. Other Tips If you are trying to save properties and you receive the error  Status Code[401] Body: [{“message”:“Session expired or invalid”,“errorCode”:“INVALID_SESSION_ID”}],  try generating a new security token. Make sure that you are not changing the consumer key. Check that the dynamic or bulk share configuration in ServiceNow for sharing out records uses  AES128  as the cipher. Check that the table map in ServiceNow specifies  JSON  as the format. You may get this error related if you are replicating a record to Salesforce and your record includes a reference field to another table. For example, if you have a Case record and are referencing the Account field, your JSON may look like this: And you may get this error: In this case, because your reference field (Account) is referencing another table and you're passing the Id value of a record into that table, you would want to use the field name with “Id” appended to the end, i.e.  AccountId , like so: Custom fields And what about for custom fields? Set the Id value to the API Name of the field - it will need to use the 18 character (not 15) Id value. For example: When replicating records into Salesforce, you may get this error as datetime fields may require values in the IS0 8601 format. Depending on the formatter set with your datetime field (check with your Salesforce administrator), this would be in the format  2007-04-05T14:30:12.000Z  or  2007-04-05T12:30:12-02:00 . For example: By default, records modified by the Salesforce application will show the user who started the Perspectium Replicator Subscriber job in the  created by  and  last modified by  fields. If you want to change this user in order to reflect the actual user, you can pass in ID values for the CreatedById and LastModifiedById fields. To do so, you need to enable  Create Audit Fields . Once enabled, you'll be able to set these fields when creating new records. Since these fields are intended to be audit fields,  you will only be able to set them on create, not update . If the records already exist in Salesforce, they will need to be exported to a .csv file, deleted in Salesforce, and then imported with the updated information as new records. Can't find what you're looking for?     See  the FAQ  or contact  Perspectium Support .