By calling a SAP Business One API endpoint I’m getting all the stock adjustments that were made in our warehouse. The response from the SAP endpoint contains all the data I need but when I deserialize this data to an object with the help of JSONConvert not all the data is returned.
Does anybody recognizes this Problem?
Class definition:
public class SAPAdjustmentAF
{
public string odatametadata { get; set; }
public Value[] value { get; set; }
public class Value
{
public Inventorygenexits InventoryGenExits { get; set; }
public InventorygenexitsDocumentlines InventoryGenExitsDocumentLines { get; set; }
}
public class Inventorygenexits
{
public int DocNum { get; set; }
public string DocDate { get; set; }
}
public class InventorygenexitsDocumentlines
{
public string ItemCode { get; set; }
public string WarehouseCode { get; set; }
public float InventoryQuantity { get; set; }
public int LineNum { get; set; }
public float Price { get; set; }
}
}
Code:
response = client.GetAsync(uri).Result;
result = response.Content.ReadAsStringAsync().Result;
result: (https://i.sstatic.net/3GxIbxIl.png)
SAPAdjustmentAF respSAP = JsonConvert.DeserializeObject(result)
InventoryGenExits: data is correct.
(https://i.sstatic.net/APPkR58J.png)
InventoryGenExitsDocumentLines: data is missing
(https://i.sstatic.net/oyIuKSA4.png)
I tried a lot of changes but none of them gave me the data I want.
I’m totally lost…there is also no error shown.
Thank you!
Kind regards,
Bert
Bert is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.