ContributionsMost RecentMost LikesSolutionsRe: Salesforce SOAP Merge Hi, I am attaching a gutted version example: Salesforce SOAP API Tests_2022_11_16.slp (19.2 KB) I think the original posts sums up my configuration we still use today. I think you can use other approaches to accomplish this but we’ve been using this solution for years now successfully for SF Merge requests. Be warned: Always try and test in DIT/FIT environments. My SOAP Execute snap is using WSDL file called “SFDC_Ent_wsdl.jsp.xml” that I generated (and named) out of the Salesforce.com account we’re using. (This step might need elevated admin user in SF.com). It contains things such as the server url (FIT in my example) to be used by the SOAP snap. There is a way to link to the SF.com file thru a url if you like (does not work for me due to security). The SOAP Exec snap is able, using account user and password, to establish a login. In the SOAP Exec snap there is a button to “customize envelope” that I used to insert my service account credentials (I think today better option to this exists using SL account): After successful login we receive a session ID and server url to be used in my XML file and in Rest Post snap steps. The earlier XML example in the past was for using a SOQL, the one below is what I used for merging accounts in Salesforce.com: Note: I had to figure out to include “<ns0:masterRecord xsi:type=“ns1:Account”>” to let SF know what object ids I’m merging in the XML. It was not part of my generated WSDL file generated for some reason but was required. Note: You can specify additional attributes in the requests such as “fields to null” on a merge request, see Salesforce.com documentation. The shared merge code generates the XML file we use in the final REST Post snap to send all the SF IDs we want to merge in the example above. We have been using a join and group by to generate the XML list with groups of 15 for the POST snap (example below how you can use a group and list to feed into the XML). Re: SalesForce - REST API with OAUTH2 Token Auto Refresh Issue Hi. Don’t use the “Account” because it does not work for the API account for SF, it won’t let you auto refresh the token because no expiration date so it’s useless. This is the workaround. You need to get authorization from your Salesforce server and copy the “refresh token” that you receive. Then in the SnapLogic pipeline add a REST POST snap, and for service url in the snap provide the following server url: https://login.salesforce.com/services/oauth2/token?grant_type=refresh_token&client_id=abc1&client_secret=abc2&refresh_token=abc3 Provide the correct clientid, secret, and refresh token in the url and the rest post snap will generate a grant authorization for you. Since the refresh token does not expire, you can use this snap since it won’t expire in any job. I’ve attached a sample pipeline for reference. No account should be associated with the REST snaps for this. SFDC_Auth_Sample_API_2019_01_18.slp (7.54 KB) Re: SalesForce - REST API with OAUTH2 Token Auto Refresh Issue Hi, actually in my SF instance the refresh token does expire but can be refershed using refresh token request. I use a REST POST snap each time I want to access the SF API to refresh my token first just in case if it expires, using the grant type refresh_token. To receive a refresh token, follow these steps documented here: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_understanding_oauth_endpoints.htm Basically you need to first receive the authorization code. Then use it to request a refresh token using the “/token” url request. In SnapLogic, before each of my API calls I refresh the token first using this in REST Post Snap service URL configured like here: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_understanding_refresh_token_oauth.htm using refresh_token grant type. It’s sad that we can’t create a SnapLogic Account for Salesforce API because the token does not have an expiration date (mandatory per SnapLogic). That would have made this a lot easier and the tokens would refresh automoatically if selected to do so on the SL account. That is why I have to refresh the token manually in each of my pipelines as step 1 by using the REST POST snap and calling the /token url to refresh it, then pass the token to my REST GET snap to be used in the header to get my data out of SF. Re: Salesforce Delete snap - Any way to slow down batch execution between each batch submitted? I found on the community that using script task lets me do this: Salesforce Delete snap - Any way to slow down batch execution between each batch submitted? Hi, We’re doing some old record cleanup in Salesforce and I am using Salesforce Delete snap in Snaplogic to perform the deletions in 10k batches. Because Salesforce has very low record limits on certain objects like Notes (20k records limit), we are having a hard time performing sync with our AWS database. What I would like to do is, slow down each 10k batch execution on the Delete snap. For example, is there a way to have a wait step of 60 seconds for example before pushing and processing the next batch of 10k? Re: Salesforce SOAP Merge Ok, figured it out for those interested. I had to generate a XML file for my next Salesforce operation and pass it into the REST Post snap using the server URL: Salesforce SOAP Merge Hi, I am using SOAP snap to connect to Salesforce. I am able to get a session id back. Using the session id, I want to perform a Salesforce SOAP API Merge() call. I am able to generate a merge envelope and using a mapper I feed in a master record and a record to merge: But for some reason I keep getting the following error on the merge SOAP step: “error”: “MISSING_ARGUMENT: merge called with a batch of 0 ids to merge; must specify at least 1 id” I bet I am missing something simple. Can anyone chime in what that might be? Re: Salesforce to Redshift data load Hi, My org uses one of the first Salesforce adaptations and is one of the largest configurations the company offers so these might be issues that affect larger instances of Salesforce. But in case you start noticing data sync issues/accuracy over time, here are some things you might want to check over on your syncs. In regards to using “LastModifiedDate”, you might want to evaluate your Salesforce system for another datetime field called “systemmodstamp” that should be available on almost every object. I found this field to be much more accurate because it’s modified when the record is updated by internal and external apps that your org might be using in Salesforce. Through comparisons I was able to find in my environment where the LastModifiedDate was not updated but systemmodstamp was a lot more often. Another tip I have is around deleted records, aka isdeleted field. You will learn that hard deleted records do not end up in SF Recycle bin so the isdeleted flag does not get marked and the record just disappears in SF. The only way to get a list of these is to use REST API or SOAP API calls to Salesforce for objects that your SF admin has enabled "Data Replication” option. More info is located here about that: Salesforce Developers https://developer.salesforce.com/page/Sample_SOAP_Messages Salesforce Developers Unfortunately there are no Salesforce Snaps that allow you to use these SOAP and REST API functions. If you need to use them, you will have to use the REST API or SOAP API Snaps to get this data out of Salesforce. I’ve submitted last year to SnapLogic all these as product enhancements ideas but haven’t seen them on the product road map yet. I had to learn all of this the hard way after running few audits after time. My Redshift Salesforce data was constantly out of synch because of these issues. These days I have 99.99% accuracy in audits and run data syncs between SF and Redshift every hour on some of our larger active SF objects and daily on others. Re: SalesForce - REST API with OAUTH2 Token Auto Refresh Issue Hi, Yes, the issue still exists for me. I already talked with support but did not get any solution to this issue and I was wondering if anyone else has issues using the “auto refresh” Salesforce token for a OAUTH2 account in SnapLogic. Support tells me I cannot auto refresh an account token without a token expiration date on the account so I’m stuck. SalesForce - REST API with OAUTH2 Token Auto Refresh Issue Hi, Is anyone using REST Get snap with Salesforce instance using OAUTH2 account? I am having trouble with keeping my Account tokens up to date. I am able to connect and receive an Access Token and a Refresh Token on my account using the Account “Refresh” button. But SF does not provide me back a “Access token expiration” time. Apparently per SnapLogic support, I cannot enable “auto refresh token” on the account so the token can refresh without an expiration date on the token. I have to manually every hour open my account settings in Snaplogic account and hit “Refresh” to receive a new refresh and access tokens. If not, my snap step returns error “Session expired or invalid”,“errorCode”:“INVALID_SESSION_ID” in all of my pipelines. It’s very frustrating and redundant having to do this multiple times a day. Is there a way to pass thru a expiration token time to the account? Or is there a way I can force a token refresh each time my pipeline runs without my input? My use case is, SF snaps do not give us ability to access rich functionality such as getdeleted() or getupdated() on SF objects. These logs contain hard deleted items per object (when the object is replicated in SF) and we use these logs to keep the data in synch in our DB without having to re-download hundreds of millions of records per object every hour which is not possible. This log data is not accessible through SOQL as far as I can see and they are not in the recycle bin (hence hard deleted) so standard snaps don’t work for this. Example of REST Get service url for hard deleted item logs: https://instance#.salesforce.com/services/data/v39.0/sobjects/AccountTeamMember/deleted/?start=2017-09-13T00:00:00-00:00&end=2017-09-15T00:00:00-00:00 SF documentation: Developer SF REST API - GetDeleted() Another way of getting these results from what I have read is to use REST API QueryAll() functionality in SF. But it uses same Account configuration. Any help of feedback is much appreciated.