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

OIC XSLT: Execute Only When At Least One Field Has Value and None Are Blank

๐Ÿ”ท OIC XSLT: Validate Fields Before Executing Logic ๐Ÿ”น Requirement Fields: field1, field2, field3, field4, field5 ✔ Execute only when: At le...