Skip to main content

I am trying to port some of my calls over from using the Rest API to using the ODATA4 interface. Using a simple call like this…

 

http://ODATAV4_URL/PX_Objects_In_InventoryItem?$filter=InventoryCD eq 'BCWICFGBLK’&$format=json

 

How to include a list of all the attributes and values associated to a InventoryItem. With the RestAPI, I could just $expand=Attributes and it would return that in the payload. I can’t seem to figure it out when using ODATA.

 

Thank you all!

 

Eric

Hi @eelliston 

You might need to retrieve the NoteID for the specific InventoryItem and then query CSAnswers for existing assigned values.

URL/PX_Objects_Cs_CSAnswers?$skip=0&$top=10&$filter=RefNoteID eq '...'

$expand works on ID columns when the navigation properties are set. For example:

URL/?$expand=<Table>By<Field>

It depends on the foreign keys of the table defined at DAC level

 

You can expand for example Item Class tied to the Item like:

URL/InventoryItem?$filter=InventoryCD eq '...'&$expand=INItemClassByItemClassID

The result comes as

 

Attributes has no foreign key defined.

 

Otherwise use RESTAPI Get call to retrieve all those details in one call. 

 

Hope this helps.

 


Reply