NDS may call to say they get an Incident Raised when they try to create a pick - e.g. #83770
Cannot insert the value NULL into column 'whs_location', table 'priarch.dbo.stock_location'; The column does not allow nulls. INSERT fails. About to call traxs_Warehouse_Picking_Edit_CreateMovement
I think it's a known issue to do with multiple allocations running before the pick is created. Don't know why, but it's caused duplicate lines on the pick for the same product but one has a NULL whs_location.
I created a version of traxs_Warehouse_Picking_Edit_CreateMovement to identify the line in question attached
SELECT A.whse_no, A.whs_location, A.product, ISNULL(A.picked_quantity, A.quantity), A.guid_request_link FROM allocation_det A INNER JOIN product PR ON PR.product = A.product WHERE A.allocation_pick = '?' AND -- pick no is in the error message in traxs_errors PR.batch_type < 3 AND ISNULL(A.picked_quantity, A.quantity) <> 0 AND whs_location is null ORDER BY -- TODO make this configurable as this is not likely to suit all people A.pick_line_no -- shows the duplicates select * from allocation_det where guid_request_link = '?' -- secure just in case select * into _allocation_det from allocation_det where row_id = ? -- update whs_location with the primary(same as duplicate) and quantity to zero so that it's not duplicated. begin transaction update allocation_det set whs_location = ?, quantity = 0 where row_id = ? commit transaction