Whenever a new line is created in the counting journal as a default process Microsoft Dynamics AX tries to lock the item to block any further transaction until the counting journal is been posted. At the time of locking AX tries to lock the item with specific inventory dimension values (configuration, size, color and warehouse) provided the record exists in the InventItemLocation (Warehouse items form). If the record doesn’t exist in the InventItemLocation table for that particular item id and inventory dimension values then AX locks the item for ‘AllBlank’ system inventory dimension which locks the item globally (along with its all variants) in all the warehouses. This makes an item unavailable across the legal entity until the counting journal has been posted.
This X++ job will create all the missing records in the InventItemLocation table for a given site provided the records exist in inventory on-hand. It requires site id as an input parameter which can be specified at line number 6 of this job.