What are the best ways to send records from Netsuite to an external system?

I am trying to integrate Netsuite to replace parts of our payment system. Sending data to Netsuite from our system is pretty trivial with web services, but what about returning information. Let's say I want to add Paid Bills back to our system when they are created in NetSuite as payment records in the database.

The simplest solution I thought of was to search and filter on the last inserted transaction ID, but this field does not accept the largeThan operator as it is a string.

Is it possible that Workflows is running scripts? that is, when Bill is created, run this script, etc., which will then send the data to some endpoint?

Any thoughts or any other advice on how to solve this problem.

Thank.

+3


source to share


4 answers


If you don't need real time, you can make an external daemon run a NetSuite lookup every X minutes via a web service. The daemon retrieves records that have not yet been submitted and sends them to an external system. I used the java daemon with Spring integration framework and it worked well.



To keep track of which records were submitted and which were not, you can add a custom boolean field to your NetSuite Paying Account record. You will set to true as soon as the record is submitted to the external system so that the next search query does not return it again.

+1


source


There are many, many options here. The solution David mentioned is one option. Your current system will require an available web API (like SOAP or JSON, REST, etc.).

If you need real-time payment data, you can create a corresponding custom script event in the relevant NetSuite records, which will push the data into the application API right after the record is created.

If you want to send data in large batches, you can write scheduled scripts that look for any records that have not yet been submitted to an external system and publish them.



You can create a saved search that runs on a schedule and send the CSV file of the results to someone who can then import it into an external system.

As an aside, you can build the search you mentioned using a field internalidnumber

instead, which the Greater Than operator will accept. It would probably be more appropriate to use a createddate

last word sorted field .

+2


source


I think there are many internal and external factors that determine the best approach. Some of these factors will be how responsive your external system is, the frequency of real-time / scheduled exports, the limits of the external system API, etc. The following is a categorization of the frequency-based approaches:

1. Export in real time

(Excellent responsive external system) Deploy custom Script event in AfterSubmit event for payment type (Cash Sale / Invoice) and use the nlapiRequestURL SuiteScript API in Script to send the data you want and get a real-time response. Note. The nlapiRequestURL API has a 5 minute connection timeout and a 45s response timeout limit. If your front-end server can exceed these limits, you need to look at other approaches.

2. Scheduled export

  • Expand the scheduled Script by Payment Record Type (Cash Sale / Invoice), which looks for records not yet exported and uses the nlapiRequestURL SuiteScript API to submit the data. Also, in this approach, you can combine multiple records and make one call to the external system (with multiple records in that batch) and export the data, rather than one call per write in the previous approach.
  • The second way to do the same would be through NetSuite Web Services (SuiteTalk), as suggested by David above.

3. In real time (This approach is a little descriptive, I have listed a high-level project)

  • Create a custom entry for queue messages.
  • Expand custom Script event in AfterSubmit event for billing type (Cash Sale / Invoice)
  • Internally in the UE, use nlapiGetNewRecord () to retrieve the record data and unload it in the custom record created above.
  • In the UE only, call "nlapiScheduleScript" to invoke the scheduled Script that will use these messages. One caveat: you can only do this if the user running the Script has administrator role permissions. This way you can keep checking the role id and then execute that line.
  • For non-administrator roles, you can also create a deployment for a scheduled Script that picks up these messages and consumes them one by one.
+2


source


You can call your endpoint using nlapiRequestURL (Suite script API) and pass information like Bill id, Amount, any other data you need from the payment record. This API can be called when Bill's entry is created in Netsuite. This way you get real-time data from Netsuite to your system.

+1


source







All Articles