Hello Marissa,
For such case you can follow two approaches,
1. Create two similar script ,
a. 1st script with a condition which IF Indicator Column = H and this script will have no loop
b. 2nd Script with a condition which will Run if Indicator Column = D and this script will have Loop around Indicator H and D
here in this case, if any order having single lines will execute 1st script to update lines with H. If any order having multiple lines will execute 1st script for Line with H and 2nd script for Line with D.
2. One single script with to handle both H and D
Divide one single script into two sections (two section will have same set of code to update quantity)
a. section one - Having script to update quantity with a condition which IF Indicator Column = H
b. section two - Having script to update quantity with a condition which will Run if Indicator Column = D and this script will have Loop around Indicator H and D
So this case, Section one will Run if any order having single line and both section one and section 2 will Run if any order having both H and D lines.
Hope this will answer your query.
Kindly try and share your feedback.
Thank you,
Santhosh BK
------------------------------
Original Message:
Sent: 01-24-2019 09:45
From: Marissa Boom-van Druten
Subject: VA02 Script - error no line items found- make loop optional?
Hi all,
Is it possible to make a loop optional? For example for multiple orders we want to change order quantities. For some orders we only have to change 1 line item for other orders multiple. So it would look like this
Indicator Order Item Quantity
H 123 10 5
D 20 7
H 124 10 9
H 125 10 8
Before it used to work fine when not adding a line item. But now when we do not incert a D (line item) we get the error message "No Line Items Found".
Thanks for advising!
------------------------------
Marissa
------------------------------