Accessing Lines on a Sales Order

Discussions relating to breakout scripting, .NET and COM programming with Jiwa objects.

Re: Accessing Lines on a Sales Order

Postby Scott.Pearce » Fri Aug 21, 2015 12:00 pm

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
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 765
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 230

Re: Accessing Lines on a Sales Order

Postby Mike.Sheen » Fri Aug 21, 2015 1:39 pm

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
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2583
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 807

Re: Accessing Lines on a Sales Order

Postby Scott.Pearce » Tue Aug 25, 2015 10:01 am

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.
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 765
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 230


Return to Technical / Programming

Who is online

Users browsing this forum: No registered users and 2 guests