The current company must be the legal entity of the source document line when calling this method.
Otherwise the correct InventDim record will not be found, or in the case of virtual companies the company() method on the selected InventDim record will yield an incorrect result.