Hi,
Im trying to make an order for an invoice that will take in some details like name, number and have an array of product details like price, qty. It uses variables used in class mods. See if you can make sense of this.
Sub webservicetest()
Dim NewOrder As New struct_XOrder
Dim LineItems(1 To 2) As New struct_LineItem
NewOrder.ClientShortName = "DemoClient"
NewOrder.OrderNumber = "12345"
LineItems(1).Qty = 5
LineItems(1).ItemComment = "comment1"
'LineItems(2).Qty = 10
'LineItems(2).ItemComment = "comment2"
Debug.Print NewOrder.ClientShortName
Debug.Print NewOrder.OrderNumber
'Debug.Print NewOrder.LineItems(1)
'''''''''''' Sample C# code - trying to replicate
NewOrder.LineItems = new LineItem[2]; // initialize to correct number of line items
LineItem XLine;
XLine = new LineItem(); // create a new line item
XLine.ClientShortName = "abcde"; // populate it
XLine.Qty = 5;
NewOrder.LineItems[0] = XLine; // place it to the array
XLine = new LineItem(); // and so on
XLine.Qty = 10;
Xline.ClientShortName = "test";
NewOrder.LineItems[1] = XLine;
''''''''''''''
End Sub