looking for some solutions? You are welcome.

SOLVED: ODATA: How to make $select in a complex results of type Array and limit them

Fábio Santos:

I have a problem and I can not solve. Consumption in WS Rest ODATA in which to send:

http://url/Items?$select=ItemCode,ItemWarehouseInfoCollection

Within ItemWarehouseInfoCollection a complex object of type array is returned, but I only need the "Locked" and WarehouseCode items.

{
"odata.metadata": "http://url/$metadata#Items",
"value": [
    {
        "ItemCode": "503009",
        "ItemWarehouseInfoCollection": [
            {
                "MinimalStock": 0,
                "MaximalStock": 0,
                "MinimalOrder": 0,
                "StandardAveragePrice": 0,
                "Locked": "tNO",
                "InventoryAccount": null,
                "CostAccount": null,
                "TransferAccount": null,
                "RevenuesAccount": null,
                "VarienceAccount": null,
                "DecreasingAccount": null,
                "IncreasingAccount": null,
                "ReturningAccount": null,
                "ExpensesAccount": null,
                "EURevenuesAccount": null,
                "EUExpensesAccount": null,
                "ForeignRevenueAcc": null,
                "ForeignExpensAcc": null,
                "ExemptIncomeAcc": null,
                "PriceDifferenceAcc": null,
                "WarehouseCode": "01",
                "InStock": 0,
                "Committed": 0,
                "Ordered": 0,
                "CountedQuantity": 0,
                "WasCounted": "tNO",
                "UserSignature": 27,
                "Counted": 0,
                "ExpenseClearingAct": null,
                "PurchaseCreditAcc": null,
                "EUPurchaseCreditAcc": null,
                "ForeignPurchaseCreditAcc": null,
                "SalesCreditAcc": null,
                "SalesCreditEUAcc": null,
                "ExemptedCredits": null,
                "SalesCreditForeignAcc": null,
                "ExpenseOffsettingAccount": null,
                "WipAccount": null,
                "ExchangeRateDifferencesAcct": null,
                "GoodsClearingAcct": null,
                "NegativeInventoryAdjustmentAccount": null,
                "CostInflationOffsetAccount": null,
                "GLDecreaseAcct": null,
                "GLIncreaseAcct": null,
                "PAReturnAcct": null,
                "PurchaseAcct": null,
                "PurchaseOffsetAcct": null,
                "ShippedGoodsAccount": null,
                "StockInflationOffsetAccount": null,
                "StockInflationAdjustAccount": null,
                "VATInRevenueAccount": null,
                "WipVarianceAccount": null,
                "CostInflationAccount": null,
                "WHIncomingCenvatAccount": null,
                "WHOutgoingCenvatAccount": null,
                "StockInTransitAccount": null,
                "WipOffsetProfitAndLossAccount": null,
                "InventoryOffsetProfitAndLossAccount": null,
                "DefaultBin": null,
                "DefaultBinEnforced": "tNO",
                "PurchaseBalanceAccount": null,
                "ItemCycleCounts": []
            },
            {
                "MinimalStock": 0,
                "MaximalStock": 0,
                "MinimalOrder": 0,
                "StandardAveragePrice": 0,
                "Locked": "tNO",
                "InventoryAccount": null,
                "CostAccount": null,
                "TransferAccount": null,
                "RevenuesAccount": null,
                "VarienceAccount": null,
                "DecreasingAccount": null,
                "IncreasingAccount": null,
                "ReturningAccount": null,
                "ExpensesAccount": null,
                "EURevenuesAccount": null,
                "EUExpensesAccount": null,
                "ForeignRevenueAcc": null,
                "ForeignExpensAcc": null,
                "ExemptIncomeAcc": null,
                "PriceDifferenceAcc": null,
                "WarehouseCode": "02",
                "InStock": 0,
                "Committed": 0,
                "Ordered": 0,
                "CountedQuantity": 0,
                "WasCounted": "tNO",
                "UserSignature": 27,
                "Counted": 0,
                "ExpenseClearingAct": null,
                "PurchaseCreditAcc": null,
                "EUPurchaseCreditAcc": null,
                "ForeignPurchaseCreditAcc": null,
                "SalesCreditAcc": null,
                "SalesCreditEUAcc": null,
                "ExemptedCredits": null,
                "SalesCreditForeignAcc": null,
                "ExpenseOffsettingAccount": null,
                "WipAccount": null,
                "ExchangeRateDifferencesAcct": null,
                "GoodsClearingAcct": null,
                "NegativeInventoryAdjustmentAccount": null,
                "CostInflationOffsetAccount": null,
                "GLDecreaseAcct": null,
                "GLIncreaseAcct": null,
                "PAReturnAcct": null,
                "PurchaseAcct": null,
                "PurchaseOffsetAcct": null,
                "ShippedGoodsAccount": null,
                "StockInflationOffsetAccount": null,
                "StockInflationAdjustAccount": null,
                "VATInRevenueAccount": null,
                "WipVarianceAccount": null,
                "CostInflationAccount": null,
                "WHIncomingCenvatAccount": null,
                "WHOutgoingCenvatAccount": null,
                "StockInTransitAccount": null,
                "WipOffsetProfitAndLossAccount": null,
                "InventoryOffsetProfitAndLossAccount": null,
                "DefaultBin": null,
                "DefaultBinEnforced": "tNO",
                "PurchaseBalanceAccount": null,
                "ItemCycleCounts": []
            },
            {
                "MinimalStock": 0,
                "MaximalStock": 0,
                "MinimalOrder": 0,
                "StandardAveragePrice": 0,
                "Locked": "tNO",
                "InventoryAccount": null,
                "CostAccount": null,
                "TransferAccount": null,
                "RevenuesAccount": null,
                "VarienceAccount": null,
                "DecreasingAccount": null,
                "IncreasingAccount": null,
                "ReturningAccount": null,
                "ExpensesAccount": null,
                "EURevenuesAccount": null,
                "EUExpensesAccount": null,
                "ForeignRevenueAcc": null,
                "ForeignExpensAcc": null,
                "ExemptIncomeAcc": null,
                "PriceDifferenceAcc": null,
                "WarehouseCode": "03",
                "InStock": 0,
                "Committed": 0,
                "Ordered": 0,
                "CountedQuantity": 0,
                "WasCounted": "tNO",
                "UserSignature": 27,
                "Counted": 0,
                "ExpenseClearingAct": null,
                "PurchaseCreditAcc": null,
                "EUPurchaseCreditAcc": null,
                "ForeignPurchaseCreditAcc": null,
                "SalesCreditAcc": null,
                "SalesCreditEUAcc": null,
                "ExemptedCredits": null,
                "SalesCreditForeignAcc": null,
                "ExpenseOffsettingAccount": null,
                "WipAccount": null,
                "ExchangeRateDifferencesAcct": null,
                "GoodsClearingAcct": null,
                "NegativeInventoryAdjustmentAccount": null,
                "CostInflationOffsetAccount": null,
                "GLDecreaseAcct": null,
                "GLIncreaseAcct": null,
                "PAReturnAcct": null,
                "PurchaseAcct": null,
                "PurchaseOffsetAcct": null,
                "ShippedGoodsAccount": null,
                "StockInflationOffsetAccount": null,
                "StockInflationAdjustAccount": null,
                "VATInRevenueAccount": null,
                "WipVarianceAccount": null,
                "CostInflationAccount": null,
                "WHIncomingCenvatAccount": null,
                "WHOutgoingCenvatAccount": null,
                "StockInTransitAccount": null,
                "WipOffsetProfitAndLossAccount": null,
                "InventoryOffsetProfitAndLossAccount": null,
                "DefaultBin": null,
                "DefaultBinEnforced": "tNO",
                "PurchaseBalanceAccount": null,
                "ItemCycleCounts": []
            }

        ]
    }
],
"odata.nextLink": "url?$select=ItemCode,ItemWarehouseInfoCollection&$skip=20"
}

My rendering is too high because of this, I have already tried to limit using $ select but I did not succeed, can anyone help me?



Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
Share:

No comments:

Recent