Page 1 of 1

API request for inventory returns e_InventoryStatusActive

PostPosted: Wed Dec 20, 2023 2:37 pm
by JuiceyBrucey
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

Re: API request for inventory returns e_InventoryStatusActiv  Topic is solved

PostPosted: Wed Dec 20, 2023 5:44 pm
by SBarnes
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


Re: API request for inventory returns e_InventoryStatusActiv

PostPosted: Thu Dec 21, 2023 10:15 am
by JuiceyBrucey
Excellent. Thank you.
Cheers