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

11g to 12c OSB projects migration points

1. Export 11g OSB code and import in 12c Jdeveloper. Steps to import OSB project in Jdeveloper:   File⇾Import⇾Service Bus Resources⇾ Se...