I have a customization project which includes a custom JSON object which i created.
foreach (PXResult<POLine> result in polineview.Select()){
POLine line = result;
if(order.OrderNbr == line.OrderNbr) {
// Sample JSON object
var sampleJsonObject = new
{
OrderNbr = order.OrderNbr,
CustomerOrderNo = "CS0005",
CusomterOrderLineField = new
{
PartNo = "P002",
UnitCost = line.CuryUnitCost,
InventoryID = line.InventoryID
}
};
string json = Newtonsoft.Json.JsonConvert.SerializeObject(sampleJsonObject);
PXTrace.WriteInformation(json);
}
}
JSON Data:
{
"OrderNbr":"000453",
"CustomerOrderNo":"CS0005",
"CusomterOrderLineField":{
"PartNo":"P002",
"UnitCost":367.640000,
"InventoryID":18066
}
}
My API is http://testinstance/api/InsertTestPO
I have an action called ReleaseFromHold. When i perform this action I want to send this json object data to my above mentioned API to perform a POST request through the customization project itself.
How can I do it ?