Page 1 of 1

Re: Accessing Lines on a Sales Order

PostPosted: Fri Aug 21, 2015 12:00 pm
by Scott.Pearce
You could use a For loop:

https://msdn.microsoft.com/en-us/library/5z06z1kb.aspx

or you could use a For Each loop:

https://msdn.microsoft.com/en-us/library/5ebk1751.aspx

For our sales order object specifically you could use something like:

Code: Select all
For Each existingSalesOrderLine As JiwaSales.SalesOrder.SalesOrderLine In mySalesOrderObject
   If existingSalesOrderLine.PartNo = "Fred" Then
      Msgbox("Sales order line no. " + existingSalesOrderLine.ItemNo + " has a part no. of '" + existingSalesOrderLine.PartNo + "'.")
   End If
Next

Re: Accessing Lines on a Sales Order

PostPosted: Fri Aug 21, 2015 1:39 pm
by Mike.Sheen
aegean66 wrote:Thanks for the reply.

I'm just experimenting with the Form Loaded event with this code, and I get the following error?

Image


Your image:
Image

For some reason does not display, but when I go to the dropbox it is linked to I see the image:
screenshot.jpg


Now that we can see the image, it is apparent you are using version 6 of Jiwa, not version 7. The guidance Scott gave you was for version 7 as that is where you posted this thread.

I'm moving this thread to the version 6 forums, where it will be dealt with there.

Mike

Re: Accessing Lines on a Sales Order

PostPosted: Tue Aug 25, 2015 10:01 am
by Scott.Pearce
Off the top of my head the lines can be accessed through SalesOrderObject.SalesOrderLines. Do note, however, that the collection may not be initialised until after the form loaded breakout is fired.

There is also some developer documentation at "C:\Program Files\Jiwa Financials\Jiwa\Help\Developer Documentation\Jiwa Sales Orders.chm" which you might find helpful.