Custom field lookup to locate items on a specific sales orde  Topic is solved

Discussions relating to Jiwa 7 plugin development, and the Jiwa 7 API.

Custom field lookup to locate items on a specific sales orde

Postby DannyC » Thu Dec 24, 2015 12:12 pm

Hi,

My question is both Jiwa-specific and also a VB.Net programming issue.

I am using the Service Manager module as kind of big Customer Satisfaction Analysis Incidents module, so I need to locate an invoice no, and the items just on that invoice. The client will be using it to handle a fairly complex returns process.
I can easily create a custom field to lookup sales orders.

I have another custom field which will also be a lookup to select an item on the selected sales order from the above custom field.
I figured I could use the jswInventory as a lookup which is easy enough but how could I restrict it to just display the items on the sales order?

I tried creating a List (see attached) but I can't work out how to change the jswInventory search filter to just get the items contained in myList. I doubt it is the best way to approach this so would welcome your feedback.

And have a great Christmas guys. Really appreciate your help this year.
Attachments
Plugin Service Manager customisations.xml
(35.51 KiB) Downloaded 519 times
User avatar
DannyC
Senpai
Senpai
 
Posts: 718
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 31

Re: Custom field lookup to locate items on a specific sales   Topic is solved

Postby Mike.Sheen » Mon Jan 18, 2016 11:47 am

DannyC wrote:I figured I could use the jswInventory as a lookup which is easy enough but how could I restrict it to just display the items on the sales order?


You were on the right track by using a where clause for the item being in a given set - I think you got stuck here:

Code: Select all
existingSearchOption.SQLStr += " IN_Main.InventoryID IN (" & myItems & ")"


As myItems is a list, you'll need to iterate and build the string like so:

Code: Select all
If myItems.Count > 0 Then            
   Dim filterItems As String = ""

   For Each item As String In myitems
      If filterItems.Trim.Length > 0 Then
         filterItems += ", "
      End If
      
      filterItems += "'" + item + "'"
   Next

   existingSearchOption.SQLStr += " IN_Main.InventoryID IN (" + filterItems + ")"
End If
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: Custom field lookup to locate items on a specific sales

Postby DannyC » Mon Jan 18, 2016 3:53 pm

Awesome Mike.
That has done it.

The attached plugin was a bit faulty, but once I sussed it out it works just great!

Cheers

Danny
User avatar
DannyC
Senpai
Senpai
 
Posts: 718
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 31


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 4 guests