AnsweredAssumed Answered

Determine order type based on line items

Question asked by BenMiller3461 on May 17, 2016
Latest reply on Jun 6, 2016 by BenMiller3461

What I'm trying to accomplish is a way to flag an order as an embroidery order.  If the order is embroidery it will always have a specific line item.  I made a javascript process that updates a dynamic process property when it finds an embroidery line.  The problem is it apparently is updating the dynamic process property to null when it finds a line that is not an embroidery line.  So my process works great as long as the embroidery line is the last line to get processed but if it is not then it doesn't work. 


My problem is I don't know how to keep it from updating the dynamic process property on lines that do not match what I'm looking for.  In the example below 616 is the order type id for an embroidery order but apparently else {} sends a null or empty value and clears out my embroidery, prompting the default order type in the map.  I'm pretty sure that this should be relatively simple but everything I have tried seems to end up being overly complex. 


Javascript that I am currently using:

if (internal_id == 79183) {

   embroidery = "616";

} else {