Inventory search by other fields?  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

Re: Inventory search by other fields?

Postby Mike.Sheen » Wed Mar 23, 2022 11:15 am

SBarnes wrote:Interesting thing is the Auto Query doesn't error it just ignores anything it doesn't understand


That's the nature of modern deserialisers - if a field is present in the json that is not in the poco backing it, then it is silently ignored.
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: 2445
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 757

Re: Inventory search by other fields?

Postby oliverbrooke » Fri Mar 25, 2022 2:55 pm

Thanks for the replies and attention all, very much appreciated.
I will admit to being somewhat confused still though.

I get some sort of data with the following cURL request but I'm not convinced it's legit because AFAIK there should only be one match for this Aux5 value;

$ch = curl_init('https://api.CLIENTDOMAIN.com.au/Queries/InventoryItemList?Aux5Contains='.$_GET["search"].'&Fields=InventoryID,PartNo,Description,Aux5&include=Total&apikey=CLIENTKEY');

I don't necessarily need to see the Aux5 returned in the results but it seems like it would be helpful to be able to confirm...
I'm fairly sure this isn't doing what I want but I'd LOVE if anyone knew how to get this to return the details of the matching inventory item...?
Possible?
oliverbrooke
Occasional Contributor
Occasional Contributor
 
Posts: 10
Joined: Thu Mar 17, 2022 3:18 pm

Re: Inventory search by other fields?  Topic is solved

Postby Mike.Sheen » Fri Mar 25, 2022 2:59 pm

oliverbrooke wrote:Thanks for the replies and attention all, very much appreciated.
I will admit to being somewhat confused still though.

I get some sort of data with the following cURL request but I'm not convinced it's legit because AFAIK there should only be one match for this Aux5 value;

$ch = curl_init('https://api.CLIENTDOMAIN.com.au/Queries/InventoryItemList?Aux5Contains='.$_GET["search"].'&Fields=InventoryID,PartNo,Description,Aux5&include=Total&apikey=CLIENTKEY');

I don't necessarily need to see the Aux5 returned in the results but it seems like it would be helpful to be able to confirm...
I'm fairly sure this isn't doing what I want but I'd LOVE if anyone knew how to get this to return the details of the matching inventory item...?
Possible?


You can't use InventoryItemList as it does not have the field Aux5, and as such the Aux5Contains would just be ignored.

Try this:
Code: Select all
$ch = curl_init('https://api.CLIENTDOMAIN.com.au/Queries/IN_Main?Aux5Contains='.$_GET["search"].'&Fields=InventoryID,PartNo,Description,Aux5&include=Total&apikey=CLIENTKEY');
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: 2445
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 757

Re: Inventory search by other fields?

Postby oliverbrooke » Fri Mar 25, 2022 3:10 pm

Thank you Mike - that worked perfectly!!
oliverbrooke
Occasional Contributor
Occasional Contributor
 
Posts: 10
Joined: Thu Mar 17, 2022 3:18 pm

Previous

Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 10 guests

cron