General Issues

Why can't I save my Perspectium Properties?

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: 

  1. https://login.salesforce.com/services/oauth2/token
  2. https://<YOUR_SALESFORCE_ORG_HERE>.salesforce.com/services/oauth2/token (i.e., https://na112.salesforce.com/services/oauth2/token)
  3. https://test.salesforce.com/services/oauth2/token (ONLY for Sandbox org) 

Whitelist IP range

In your Salesforce, go to Setup on the top-right corner of the page. 

Go to Administer > Security Controls > Network Access, or simply type Network Access in the Quick Find / Search bar and click Network Access.

Click New. Then, fill in the required fields, Start IP Address and End IP Address, and click Save.



Why isn't my data being shared out after manually modifying my sharing Apex trigger?

After modifying a Salesforce Apex trigger, there are several points you should check to ensure that data will be shared out of Salesforce properly:

Check that your Queue ID (2nd parameter in the pspOutMessage function) matches the Queue ID for the shared queue you created in Salesforce.

To locate the Queue ID for your shared queue in Salesforce Lightning, navigate to > Perspectium DataSync > Queues. Then, click the Queue Name of the shared queue whose ID you want to locate. On the resulting page, the shared queue's Queue ID will be the alphanumeric code displayed in the page URL immediately following /persp__PSPQueue__c/ and preceding /view.


To locate the Queue ID for your shared queue in Salesforce Classic, choose Perspectium DataSync from the dropdown in the uppermost right-hand corner of the screen. Then, click Queues and click the Queue Name of the shared queue whose ID you want to locate. On the resulting page, the shared queue's Queue ID will be the alphanumeric code displayed in the page URL immediately following /PSPQueue?id= and preceding &.


(info) NOTE: The Queue ID in Salesforce Lightning will be an 18-character code, while the Queue ID in Salesforce Classic will be a 15-character code.

Check that your triggerWhere variable's value is set to the correct Base64 encoded SOQL query. To Base64 encode/decode your SOQL query, see Base64 Decode and Encode.

If using a Queue Alias, check that the Queue Alias (2nd-to-last parameter in the pspOutMessage function) matches the Queue ID for the shared queue you created in Salesforce.


SObject type does not allow triggers

When creating a new dynamic share and selecting Save Trigger, you may get the following error:

Failed to create Dynamic Share trigger [PSP_test_CaseHistoryTrigger]: Status Code[400] Body: [{"message":"SObject type does not allow triggers: CaseHistory","errorCode":"INVALID_FIELD_FOR_INSERT_UPDATE","fields":[]}]

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.


Why doesn't the Perspectium Job in Salesforce continuously run?

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

400 reason: "error":"invalid_grant","error_description":"authentication failure"

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 DataSyncconnected app to Relax IP restrictions for the IP Relaxation setting. To change this setting:

  1. Go to Setup > Manage Apps > Connected Apps
  2. Click on the arrow to the right of the Perspectium DataSync connected app and choose the Manage option
  3. Select to Edit Policies
  4. Choose the Relax IP restrictions option in the dropdown for the IP Relaxation setting.
  5. Save your changes


FAQs

How can I increase the max number of Apex jobs that will run in my Salesforce org?

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. 

What verison of DataSync for Salesforce am I running?


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

401 session expired or invalid

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.

Salesforce errors when subscribing to records from ServiceNow
  • 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.

The value provided for foreign key reference <field_name> is not a nested SObject

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:

{"Subject":"Test""Id":"00000000000001","Description":"Test","attributes":{"type":"Case"},
"Account":"20000000000002"}


And you may get this error:

The value provided for foreign key reference Account is not a nested SObject


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:

{"Subject":"Test","Id":"00000000000001","Description":"Test","attributes":{"type":"Case"},
"AccountId":"20000000000002"}

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:

Cannot deserialize instance of datetime from VALUE_STRING (JSON_PARSER_ERROR)

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:

"SystemModstamp":"2017-12-08T06:41:13.000Z"
"Arrival":"2017-12-08T00:41-0600"
CreatedById and LastModifiedById User

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 browse the Perspectium Community Forum.



  • No labels