endsWith() in business rule

sigmachiuta
Kilo Guru

Can i use current.name.endsWith() in a BR?   It doesnt seem to only be running on those conditions but is meeting all conditions.   As if the condition does not apply

function onBefore(current, previous) {

  //This function will be automatically called when this rule is processed.

  if (current.name.endsWith('foo') || current.name.endsWith('bar')){

var gr= new GlideRecord('table')   .................

}

1 ACCEPTED SOLUTION

i ended up moving the condition in the script up to the actual condition on the BR, and that worked


View solution in original post

5 REPLIES 5

i ended up moving the condition in the script up to the actual condition on the BR, and that worked