Return NetSuite Id when a new record flows from Salesforce to NS
We have an integrator.io custom flow from Salesforce (SF) to NetSuite (NS) for Customer records.
When a new customer is created in Salesforce, it flows to NS and creates a new customer record there. Obviously, a new unique NetSuite Id (InternalId) is generated in NS.
How can we get this back to Salesforce immediately to update that NS Id in that corresponding SF customer record? Can we capture it as a response from the flow after every update?
Let me know your thoughts.
0
Comments
Hi Manish Thaduri,
Thanks for writing in on this and sorry for the delay in responding. I've directed this question to our SF and NS experts and will get back to you as soon as possible on this.
Hi Manish,
Yes we can get the NetSuite Id from the response and we can update to Salesforce Account. But here we will face an issue with infinite loop problem, once NetSuite Id is updated back to Salesforce it will trigger again, in order to not to trigger once again we need to make some changes in the flow.
Please follow the below instructions to write back the "NetSuite Id" to Salesforce and to stop infinite loop problem as well.
Step 1:
3. Once you opened scroll down to Advanced section --> "Skip export field ID" . Add the checkbox field which you have created in Salesforce Account and save it.
Step 2 :-
- After NetSuite Import bubble (As per first image), Please create another import to Salesforce Account to Write back the NetSuite Id.
- add Import Lookup criteria as per below image.
- In First Import (customer Import), their will be a plus icon (Define Options), Once you click on it it will get extended as per below image..
- The one which hover on the above image please click on it.(response Mappings icon)
- Please add the response Mapping. in left side we will get drop down fields add "Id". in right-side please write the field name as NetSuiteId.
- In second import Add the Mapping for the one which we created for to "writeback the netsuite Id to Salesforce"
- Mappings image.
- Here "NetSuite Id (IO) and "skip Export To NetSuite" are my custom fields. in Place of NetSuite Id add your External Field and in place of "skip Export To NetSuite" add your checkbox field which we created in first Step.
Hope this will helpful. Please let me know, if you have any doubts.
Thanks,
Thanks for the detailed explanation and steps. I followed your steps and configured it.
Little confused about the setting 'Skip Export field Id'. ( I couldn't find the complete details of this field in the help center).
In the 2nd import, the custom field 'Skip Export To NetSuite' is set as 'True'. Now my Salesforce records which are processed in this flow have this value set as 'True'. Will this True remain forever and when will this be set as 'False'? Does the first export, set this value as 'False'? How is this field helping in stopping the infinite loop?
I think this flow is still running in an infinite loop because I have another flow 'NetSuite to Salesforce' on customer records to process any customer records.
How do I stop these 2 flows to be in an infinite loop?
Hi Manish,
1. The field 'Skip Export to NetSuite' is syncing to external system (Salesforce report below)
2. Yes, I set it Salesforce export listener
3. I set the skip export field as True in Salesforce mappings (2nd import). Are you referring to this flow SF to NS or something else here?
In the response mapping, I'm capturing the NetSuite Id and passing it back to Salesforce. Yes, this is successfully captured in the Salesforce's NetSuiteId field (along with the 'Skip Export to Netsuite' field value True).
Hi Manish,
yes, you have configured correctly, but not sure why skip export to NetSuite is still in check in your Salesforce Account. Ideally it has to uncheck automatically.
I would like to check the apex trigger. Can you Send me the screenshot of apex trigger code, the one which we recommended to create in your Salesforce Account sObject.
Is the value saved as True because we are explicitly setting it as True in the 2nd import mapping?
Here is the apex trigger
Yes, whenever NetSuite Id updated back to Salesforce we shouldn't invoke the flow again from Salesforce to NetSuite, that's the reason we are explicitly setting it as true. so that it will automatically gets false and will skip the record..
Thanks for the sharing the apex trigger... we need to do small changes, the one you have right now is old logic...
Please use the following trigger
trigger AccountCeligoTrigger on Account (after insert, after update) {
integrator_da__.RealTimeExportResult res = integrator_da__.RealTimeExporter.processExport();
}
Rightnow you have runbatch() in place of this we have implemented new method for advance functionality. method name : processExport()
This have more advance level functionality like to solve infinite loop, batch of records..
You can able to see the required trigger in Salesforce Export listener itself..
Please change accordingly, then it will work as expected.. that means it will not goes into infinite loop and as well as it will gets uncheck automatically when ever we set skip export to NetSuite as true..
Please add the mapping "Skip Export to NetSuite" as true in NetSuite Customer to Salesforce Account Mapping as well..
Please let me know if you have any queries..
Ah, the new method processExport() is not available in our Apex classes. We are on version 1.14.1 of our package in Salesforce. Need to upgrade to latest version.
Which is the latest version of this package? 1.7? Can you please provide the link to the package?
I did try upgrading but facing some issues. Checking with Salesforce support on this too.
Hi
one quick question..
do you have license for Salesforce Integration App ? then why your doing DIY flow to sync Account ?
Can you send me the screenshot of installed packages related to Celigo other than "Integrator Distributed Adaptor"?
Yes you need version 1.15 above for "Integrator Distributed Adaptor" to work
v1.15.1 Link :- https://login.salesforce.com/packaging/installPackage.apexp?p0=04t3m000002NP28
Because the Salesforce Integration App doesn't support Person Accounts. Right?
Upgraded the package and tried to change the trigger code to use the new method. It fails to save because of this error.
Hi Manish,
I think its because of you have older version in your version settings.
Please follow the steps
2. open the Version Settings and check "Integrator Distributed Adaptor" settings. check version should be greater than 1.15.
right now you have installed 1.15.1 so please change it to 1.15.1
3. Now check using method processExport
and regarding the above comment, I didn't get it why it was not supported "Salesforce integration app" in partners account ? did we find any reason for it ?
Please sign in to leave a comment.