inputContext.isRestarted

Property Description

Indicates whether the current invocation of the getInputData(inputContext) function is the first.

Usually, the getInput function runs just once. But if it's interrupted by an application server restart, the system restarts getInputData function.

If the value of this property is true, the getInputData(inputContext) has been restarted.

You can use this property to make your script more robust.

Type

boolean (read-only)

Since

2016.1

Syntax

The following code snippet shows the syntax for this member. It's not a functional example. For a complete script example, see SuiteScript 2.x Map/Reduce Script Code Samples.

          ...
function getInputData(context) 
{
  if (context.isRestarted)
  {
    log.debug('GET_INPUT isRestarted', 'YES');
  }
  else
  {
    log.debug('GET_INPUT isRestarted', 'NO');
  }

  var extractSearch = search.load({ id: 'customsearch35' });
  return extractSearch;
}
... 

        

Related Topics

General Notices