'Creditor warehouse not found' error reported when loading inventory in a newly upgraded 6.5.13 database

Problem

Loading some inventory items in a newly upgraded 6.5.13 /7.00.xxx database reports 'Creditor warehouse not found.'

 

Solution

The issue is caused by IN_SupplierWarehouse records which are linked to a warehouse not belonging to the creditor.  The issue probably stemmed from Version 6 which tolerated incorrect linking and the bad records were ignored. Version 7 does not tolerate this inconsistency.

Advance SQL Programming skills required

Completing this troubleshooting article requires advanced SQL Programming ability.



This query identifies the bad records and shows which creditor the warehouse belongs to:

The following script will set the WarehouseID to be the default warehouse for the creditor for those IN_SupplierWarehouse records that are affected:

Test this out on a backup copy of the data before running live.