Tuesday, March 23, 2021

OIC - JS - Return boolean status based on ERP result status

Requirement:

From ERP we are getting Import status as 'SUCCEEDED','WARNING','ERROR','CANCELED' and we need to convert it to boolean status like true or false.

JS code:

function returnStatus(result) {

 var inProgress;

  if (['SUCCEEDED','WARNING','ERROR','CANCELED'].indexOf(result)==-1)

  {

  inProgress = "true";

  }

  else

  {

  inProgress="false"

  }

  return inProgress;

}

No comments:

Post a Comment

Featured Post

Microsoft Excel - List Functions

 Working... Introduction to Excel’s Database Functions Excel's Database Functions work with data ranges treated like a database table ...