I have a script that, given some conditions, is supposed to ensure a bin is set on each line item when saving an item receipt. The issue is, the nlapiViewLineItemSubrecord ('item','inventorydetail',i); api returns null even when there is a bin chosen. Once you click the inventory detail manually and close it again, it returns the detail object as expected.