Hi Huey_Chinn Tan
Thank you for reaching out. Regarding this error, one possible reason is that when you create a line item, you enter data on the first line item, and once you create the loop, the script keeps using the same cursor position.
The best way to create a loop around line items is as follows.
1) Add the header data that is Sold to Party, Ship to Party, etc
2) Press Page down from your keyboard and then add the data on the last line of the screen

3) Now click on the Add Button at the bottom of the screen to shift the Line Item to the top level.

4) Create a Loop around these fields in the Studio.
You can also refer to the documentation below.
https://help.precisely.com/r/n/Automate-Studio/Connect/20.3/en-US/Automate-Studio-with-Connect-User-Guide/VA01-step-by-step_-Creating-a-sales-order-with-reference
If this does not resolve the issue, run a script in debug mode to identify where it is failing, or please create a support ticket by logging in to support.precisely.com; one of the engineers will assist with debugging the script.
Thanks
Archana C Singh
------------------------------
Archana Chandar
*Precisely Software Inc.
------------------------------