Inventory search by other fields?  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

Inventory search by other fields?

Postby oliverbrooke » Tue Mar 22, 2022 8:25 am

Hi there,
Is it possible to search the inventory by any fields other than PartNo?
For example, I want to search for matches within the Aux5 field.

For what it might be worth, I'm using PHP with cURL

Thanks :)
oliverbrooke
Occasional Contributor
Occasional Contributor
 
Posts: 10
Joined: Thu Mar 17, 2022 3:18 pm

Re: Inventory search by other fields?

Postby SBarnes » Tue Mar 22, 2022 9:20 am

The short answer is yes, take a look at viewtopic.php?f=27&t=184

Basically you can have any SQL you like for inventory so long as the first field is the InventoryID in the select.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1619
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: Inventory search by other fields?

Postby SBarnes » Tue Mar 22, 2022 9:24 am

In rereading you post I am now not sure if you were talking about inside Jiwa or the REST api if its the latter then the route /Queries/IN_Main would allow you to do what you want.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1619
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: Inventory search by other fields?

Postby oliverbrooke » Tue Mar 22, 2022 9:29 am

Thanks for the quick response!
I'm using the REST API.
I'm currently having limited success with it but will persevere if you reckon it's achievable :)
oliverbrooke
Occasional Contributor
Occasional Contributor
 
Posts: 10
Joined: Thu Mar 17, 2022 3:18 pm

Re: Inventory search by other fields?

Postby SBarnes » Tue Mar 22, 2022 9:34 am

Jiwa have a copy of the running api here https://api.jiwa.com.au/ that runs against a demo database, if you click on the link at the bottom for swagger ui and wait for it to load and then go to the queries section you will find the route I am talking about.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1619
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: Inventory search by other fields?

Postby Scott.Pearce » Tue Mar 22, 2022 9:34 am

Using our sample api:

1. Authenticate by going here:

https://api.jiwa.com.au/auth?UserName=a ... d=password


2. Use an autoquery, here (give it time to load):

https://api.jiwa.com.au/ss_admin/autoquery/IN_MainQuery

Play around with the column selection and filters. As you do so the URL to use is displayed at the top and is clickable.
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 742
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 221

Re: Inventory search by other fields?

Postby Mike.Sheen » Tue Mar 22, 2022 10:58 am

Another way is to go direct to the query without the UI (the UI will compose this URL for you when you choose fields and values to filter on) and searching on Aux5 and using an API key instead:

https://api.jiwa.com.au/Queries/IN_Main ... AsRJznB_Ok

Note the API key can also be passed via a bearer token request header instead.

Or even better - instead of IN_Main use the InventoryItemList view - and limit which fields are returned using the Fields= parameter:

https://api.jiwa.com.au/Queries/Invento ... AsRJznB_Ok
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: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: Inventory search by other fields?

Postby SBarnes » Tue Mar 22, 2022 4:59 pm

Aux5 isn't in v_Jiwa_Inventory_Item_List?
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1619
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: Inventory search by other fields?

Postby Mike.Sheen » Wed Mar 23, 2022 10:59 am

SBarnes wrote:Aux5 isn't in v_Jiwa_Inventory_Item_List?


Oh, lol. Don't use that if you want Aux5, then!

Making your own view which does use it and exposing the route is easy enough, however.
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: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: Inventory search by other fields?

Postby SBarnes » Wed Mar 23, 2022 11:02 am

Interesting thing is the Auto Query doesn't error it just ignores anything it doesn't understand
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1619
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Next

Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 9 guests