azeem
azeem

Reputation: 194

Increase nlapiRequestURL timeout in NetSuite SuiteScript

I am calling a suitelet(webservice) from another server side script in NetSuite using nlapiRequestURL method. This suitelet takes more than one minute to execute that cause a timeout on nlapiRequestURL.

I could not find any documented way of increasing the timeout of nlapiRequestURL. I was wondering if it is possible anyway?

Upvotes: 0

Views: 2452

Answers (2)

SuiteView Lead
SuiteView Lead

Reputation: 11

I would first look at the design of your suitelet to ensure you are using the API efficiently. Loading records in particular uses a great deal of resources and is very time-consuming. In many cases, it is preferable to retrieve the information using nlapiLookupField or, if you have many records, to use nlapiSearchRecord to retrieve data on many records at once.

However, that being said, have you considered making the process asynchronous with an initial call that requests that the data be assembled and a second call that retrieves the data from a session variable or file cache? The second call could be looped to check back periodically to look for the data. Each call to a suitelet executes independently so a second callback will not stop the first request. You can parameterize the second request to just check the session variable cache. If it's blank, return a not ready message. If the data are available, wipe out the cache and return the data.

An alternative approach, would be that suitelet A calls suitelet B and requests that data prepared. When complete, suitelet B posts the data to suitelet A, which processes it. Of course, you could equally have suitelet B use the code for suitelet A as a library to process the data without the callback. That may not be applicable to all use cases, however.

Can you tell me more about the use case?

Upvotes: 1

Rusty Shackles
Rusty Shackles

Reputation: 2840

I believe there is no way to increase this since this is a limit imposed natively.

Have you tried using nlapiSetRedirectURL instead of nlapiRequestURL?

Upvotes: 0

Related Questions