I have an SOShipment object and we store a value in INItemLotSerialKvExt. We need to access the data via OData v4 and would like to get the value in a single call when accessing the SOShipment. Essentially, for every SOShipLineSplit on the shipment, we want to get the INItemLotSerial → INItemLotSerialKvExt
Logically, it seems I could get this data like this: SOShipment → SOShipLineSplit → INItemLotSerial → INItemLotSerialKvExt. But those navigation properties do not seem to exist in the OData schema.
Instead, the best I’ve been able to find is the following: SOShipment → SOShipLineSplit → INLotSerialStatusByCostCenter → INItemLotSerial → INItemLotSerialKvExt. This seems a round about way of getting the value.
Here are the pertinent schema nodes for the links above:
<EntityType Name="SOShipLineSplit">
<NavigationProperty Name="INLotSerialStatusByCostCenterByLocationID" Type="PX.Objects.IN.INLotSerialStatusByCostCenter">
<ReferentialConstraint Property="LotSerialNbr" ReferencedProperty="LotSerialNbr" />
<ReferentialConstraint Property="InventoryID" ReferencedProperty="InventoryID" />
<ReferentialConstraint Property="SiteID" ReferencedProperty="SiteID" />
<ReferentialConstraint Property="LocationID" ReferencedProperty="LocationID" />
</NavigationProperty>
</EntityType>
<EntityType Name="INLotSerialStatusByCostCenter">
<NavigationProperty Name="INItemLotSerialByLotSerialNbr" Type="PX.Objects.IN.INItemLotSerial">
<ReferentialConstraint Property="InventoryID" ReferencedProperty="InventoryID" />
<ReferentialConstraint Property="LotSerialNbr" ReferencedProperty="LotSerialNbr" />
</NavigationProperty>
</EntityType>
<EntityType Name="INItemLotSerial">
<NavigationProperty Name="INItemLotSerialKvExtCollection" Type="Collection(SelectSires.Acumatica.DAC.AcumaticaDB.DAC.IN.INItemLotSerialKvExt)" />
</EntityType>
When doing an OData v4 call to PX_Objects_SO_SOShipment, this $expand works:
$expand=SOShipLineSplitCollection($expand=INLotSerialStatusByCostCenterByLocationID)
But as soon as I try to go deeper, $expand=SOShipLineSplitCollection($expand=INLotSerialStatusByCostCenterByLocationID($expand=INItemLotSerialByLotSerialNbr))
I get the following error:
The request includes a $expand path which is too deep. The maximum depth allowed is 2. To increase the limit, set the 'MaxExpansionDepth' property on EnableQueryAttribute or ODataValidationSettings, or set the 'MaxDepth' property in ExpandAttribute.
Can someone please guide me to a way of getting the INItemLotSerial → INItemLotSerialKvExt for every SOShipLineSplit on a given shipment?