Hi Everyone, Im checking one value in a string but...
# suitescript
n
Hi Everyone, Im checking one value in a string but seems to be not working!! below is the code: The last two logs are not showing!! includes is not working, even i used toString() in afterSubmit():
Copy code
var swm_shipping = newRecord.getValue({fieldId:'custbody_swm'});

              

              swm_shipping = String(swm_shipping);

              log.debug('swm_shipping',swm_shipping);

              var swm_ship = swm_shipping.includes("ups");

              var swm_ship1 = swm_shipping.includes("UPS");

              log.debug('swm_ship',swm_ship);
              log.debug('swm_ship1',swm_ship1);
n
Do you have a try/catch? Does it catch something? Are you using suitescript 2.1?
n
nop, 2.0!! i found other way though!!! Thanks
j
If I remember correctly, 2.0 doesn't support includes().
💯 1
n
okay cool thanks