Good morning everyone - I have a bit of a stumper here. I am trying to update item fulfillment records with a scheduled script. Specifically, I am updating tracking information. The challenge with this is the "package" line type is not always just called "package". In some cases, it is "packageups" or "packagefedex" or just plain "package". Now, I have a function written that works perfectly in the console, but in the schedule script it bombs out with an error message stating that the lineitems are undefined. I am essentially trying this:
var tranLines = ifRec.lineitems;
var ups = tranLines.hasOwnProperty('packageups');
var fedex = tranLines.hasOwnProperty('packagefedex');
and then I go into some if logic on how to update each of those specific line types.
The error message is specifically - cannot call method "hasOwnProperty" of undefined.
thanks in advance for any thoughts or assistance!!