inventory item list check  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

Re: inventory item list check

Postby SBarnes » Sat Feb 25, 2023 6:07 pm

I got


Code: Select all
{"Results":[{"InventoryID":"00000000040000000002","PartNo":"8100044"},{"InventoryID":"0000000009000000000J","PartNo":"8100052"},{"InventoryID":"00000000090000000013","PartNo":"8100206","Status":2}],"Meta":{}}


notice the third one has the status the explanation for which is it is actually executing the SQL

Code: Select all
SELECT InventoryID,PartNo,Status
  FROM [dbo].[IN_Main]
  where partno in ('8100044','8100052','8100206')


when I run the SQL the first two have a status of zero and because 0 is the default for the integer field the api doesn't return it.

This is actually by design and can actually be changed in plugin code in Jiwa with

Code: Select all
ServiceStack.Text.JsConfig.ExcludeDefaultValues = false;


or commenting it out in the REST api where its set to true, but the answer is simply when a field is not there accept the given that it is the default for that type such as strings are empty strings, numbers are zero and anything else will be a null.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1619
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: inventory item list check

Postby Scott.Pearce » Mon Feb 27, 2023 8:52 am

JuiceyBrucey wrote:I tried it out but did not have any success.

You need to use InventoryIDIN for multiple InventoryIDs, not InventoryID=. Check your URLs very carefully against my examples.

JuiceyBrucey wrote:it did not return the Status field.

Scott.Pearce wrote:Status
-------
<blank>, 0, <no status tag returned> = Active
1 = Discontinued
2 = Deleted
3 = Slow
3 = Obsolete
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 item list check

Postby JuiceyBrucey » Mon Feb 27, 2023 9:09 am

I should have read this a bit more closely.
When value is zero, no key>value returned.
Thank you very much. Great support.
Cheers

Scott.Pearce wrote:You could use an AutoQuery like:

https://api.jiwa.com.au/Queries/IN_Main ... tNo,Status

Status
-------
<blank>, 0, <no status tag returned> = Active
1 = Discontinued
2 = Deleted
3 = Slow
3 = Obsolete

Don't forget to authenticate first:

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

To design your own AutoQueries go to:

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

and search for IN_MainQuery using the filter on the left (give it a few seconds to load - there are a lot of tables).
JuiceyBrucey
Frequent Contributor
Frequent Contributor
 
Posts: 132
Joined: Tue Aug 18, 2020 7:19 pm
Topics Solved: 1

Previous

Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 24 guests