0
votes

We are using Jitterbit to sync user between SalesForce and NetSuite, we are doing this with an endpoint that takes in the query parameters of Id which is working but i also want to sync all users if the url query parameter is not present. The reason for this is to sync all users once a day.

So this is the query that i am using

SELECT Id, City, Email, FirstName, IsActive,  LastModifiedDate, LastName, Phone, PostalCode, State, Street ,Country 
FROM User 
WHERE LastModifiedDate = TODAY AND (Id != null or Id =  '[SFDCID]')

How can I write the query to pull all users when Id is not in the URL string but still continue to pull just the one record when the SFDCID is present in the url string?

1

1 Answers

0
votes

Two different simple SOQL queries must be switched in your application.

SELECT ... FROM User WHERE LastModifiedDate = TODAY AND Id =  '[SFDCID]'
SELECT ... FROM User WHERE LastModifiedDate = TODAY

This is due to restrictions of SOQL language, because the expression on the left side of the elementar SOQL fieldExpression must be a field of the object, not a constant.

What you did want is approximately this (That is now allowed in SOQL. You can not compare a constant to constant.)

WHERE LastModifiedDate = TODAY AND (Id = '[SFDCID]' OR '[SFDCID]' = '')