Hello Team,
I have been working with SAP CP mobile kit for IOS since couple of months and its going out well.But i am getting an issue during post operation it seems.Error Description follows..
{"code":"SADL_ENTITY_RUNTIME/006","message":"Precondition required for action in entity CDS~A_WAREHOUSEORDER (If-Match missing)","propertyref":"","severity":"error","target":"","transition":true}],"timestamp":"20200615075445.3279150","transactionid":"3F047119CA7E01F0E005ED1BFEA0E493"},"message":"Precondition required for action in entity CDS~A_WAREHOUSEORDER (If-Match missing)"}
I believe the beauty of the sdk is that itself handles all header options automatically if onboard through standard procedure.
But somehow am getting the above error once after calling the Get operation am performing the update scenario.Please find the below code snippet.
varapiWhOrderTaskEntitiesObj : CdsApiWarehouseOrderTaskEntities<OnlineODataProvider>!
GET operation
let query = DataQuery().filter(WarehouseOrderType.warehouse.equal(entertedWareHouseNo).and(WarehouseOrderType.warehouseOrder.equal(wareHouseOrderNumber))).expand(WarehouseOrderType.toWarehouseTask)
apiWhOrderTaskEntitiesObj.fetchWarehouseOrderType(matching: query, headers: nil, options: nil, completionHandler: { (wareHouseOrderTypeList, error) in
print("dynamic proeprties are \(wareHouseOrderTypeList?.dynamicProperties)")
if wareHouseOrderTypeList != nil {
self.ordersListArray = wareHouseOrderTypeList.flatMap { $0.toWarehouseTask}!
}
for _ in 0..<self.ordersListArray.count {
self.selectedIndexArray.append(false)
}
self.orderListTableView.reloadData()
})
After selecting the task i'm calling the update case
UPDATE
let orderAssign = try apiWhOrderTaskEntitiesObj.assignWarehouseOrder(warehouse: entertedWareHouseNo, warehouseOrder: wareHouseOrderNumber, warehouseResource: SelectedWareHouseType, query: nil, headers: nil, options: nil)
print("wHOrders are \(orderAssign)")
Please help on this