Duplicate Key Error Message When Creating New Shipment

 
 
This is a data issue in table wsPkgShipment.
 
Solution:-
 
Run this query to see if you actually have a shipment number "0" and if there are any packages tied to it. 
 
select s.shipment_no, p.pkg_no, pl.ord_No
from wspkgshipment s
left join wspkg p on s.shipment_no = p.shipment_no
left join wspkglin pl on p.pkg_id = pl.pkg_id
where s.shipment_no= 0
 
If results of query have shipment no = 0 and pkg_no and ord_no are blank.  Try deleting the shipment record
 
-- delete wspkgshipment where shipment_no = 0


Also check the next shipment_no in Agility Explorer and verify that doesn't have a value of 0.
if it does you would need to look at the table and update it to the next shipment number it should be.)