API request for inventory returns e_InventoryStatusActive  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

API request for inventory returns e_InventoryStatusActive

Postby JuiceyBrucey » Wed Dec 20, 2023 2:37 pm

7.2.1 SR 16
Hi,
I am doing a request using the Inventory/{inventoryID} on the API.
Every thing is fine except I cannot understand how the Status field is returning 'e_InventoryStatusActive' when the Status field in the database is a type smallint.
As I understand it, the status should be 0 for active and 1-4 for any other status.
What am I missing here?
Thank you.
Cheers
JuiceyBrucey
Frequent Contributor
Frequent Contributor
 
Posts: 132
Joined: Tue Aug 18, 2020 7:19 pm
Topics Solved: 1

Re: API request for inventory returns e_InventoryStatusActiv  Topic is solved

Postby SBarnes » Wed Dec 20, 2023 5:44 pm

The reason it is returning that description is because the status on the inventory business object is an enumerated type and so a string is returned as the description of the enumerated type value, if you call queries/IN_Main, you will get the numerical value however be aware that the api by default does not return default values so when the status is active (0) you won't get the property but for all other statuses you will get a value.

Below aare the statuses and their values.

Code: Select all
  Public Enum InventoryStatuses
        e_InventoryStatusActive = 0
        e_InventoryStatusDiscontinued = 1
        e_InventoryStatusDeleted = 2
        e_InventoryStatusSlow = 3
        e_InventoryStatusObsolete = 4
    End Enum

Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1619
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: API request for inventory returns e_InventoryStatusActiv

Postby JuiceyBrucey » Thu Dec 21, 2023 10:15 am

Excellent. Thank you.
Cheers
JuiceyBrucey
Frequent Contributor
Frequent Contributor
 
Posts: 132
Joined: Tue Aug 18, 2020 7:19 pm
Topics Solved: 1


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 22 guests