Reputation: 1
I just want to make sure I am on right path, so need your guidance.
I am working on a project where I need to integrate NetSuite with a third party application. The third party application exposes their API's in the form of -
http:// www........asmx url
So I have build code as a 'User Event' script in NetSuite to invoke this API; issue the SOAP request; use nlapiRequestURL()
to get that request in XML; format the data; and then use code such as:
customerRecord.setFieldValue('comments', response.getBody());
to add the value in NS database? Is this the correct way?
I have a scenario where I need to search for all the new Sales Orders, Customers, etc. created in the third party application to be integrated into NetSuite within 5-10 min. How can I achieve this? There is no trigger in the third party application but only those APIs.
Do I need to write a scheduled script to replicate what I am doing in user event script?
Can someone please suggest the correct method?
Upvotes: 0
Views: 4249
Reputation: 2288
Yes, Of course things will be much easier if you opt a schedule script in your scenario. User Events are much like action based and doesn't fit the criteria where you have to check every 10 / 15 minutes to find out the updated records.
While using nlapiRequestURL()
be aware that there are two versions
of this API :
Again it matters how you're syncing your NS with another third party App. From your view point I can see you want to replicate all the changes from external server to NS. But be sure that you filter the transitional data well to get only the created / updated record. Otherwise you'll be end up with calling 10,000 records unnecessarily every 15 min. and it'll put a load on the NS.
However coming to your later query, NS does provide the flexibility to use Java, .Net,PHP and of course Suitescript. So you can use the either one that suits your requirement. If your incoming data is SOAP based then definately you need an XML parser to parse it. So you can use Java or .Net any of your choice. Otherwise if its in JSON and you want a light weight medium, then you can opt suitescript and it'll ease your doing.
Upvotes: 1
Reputation: 593
You should always do such things within the NetSuite Scheduled Scripts. NetSuite User Event should not be used as they always require a user action (Record Load, Record Submit) to happen on a NetSuite Record Type for their invocation.
For your use case "search for all the new Sales Order, Customer etc created in third party application to be integrated into NetSuite within 5-10 min", its a good candidate for a scheduled job that searches for all the new data on an external system and then puts it back in NetSuite. Also, since Scheduled Scripts have higher (10000) API Usage Points Limits, you could process a lot many records in a Scheduled Script.
Upvotes: 0