Moving my message here outside of general So I h...
# suitescript
m
Moving my message here outside of general So I have a question that @C_Billings was nice of enough to point me here for. I am creating a scheduled script in 1.0 that will loop through some customers and create a custom with lines in the sublist for each item. I am stumped as to how to loop through the search then create a record with a sublist of lines and then go to the next customer. I know I need nested loop but for the life of me am stumped on how to move to the second customer to create the next custom transaction.
n
Would recommend M/R - SS2.0, but if you are so inclined on 1.0, You need 2 for loops, one outer loop that will loop through your search, inside that you will load the records, and then there will be a second for loop for the loaded record to traverse through sublist and do what you want with them like you mentioned create a custom (probably record), then create it is.
Once this inner loop is executed, the outer loop will be incremented and the next search record will be fetched and the inner loop will be reset and ran again.
c
You shouldn't be writing any new code in 1.0. Its instant technical debt and no longer being maintained as per NetSuite. A 2.0 Map/Reduce script is perfect for this as you don't need to worry about any governance (99% of the time).
1000 1
true news 1