When a sales order line is added, the .SupplierInfo is not read in.
Description
When a sales order line is added, the .SupplierInfo is not read in. Only after saving and re-reading the sales order do the lines get their .SupplierInfo details populated.
Look in SalesOrderLineCollection.AddInventoryItem():
If salesOrderLine.SupplierInfo.RecID IsNotNothingThen salesOrderLine.SupplierInfo.ReadRecord()EndIf
I don’t think it should be “IsNot Nothing”, but instead “Is Nothing” - i.e. if there is no supplier details read in yet, then read them in (the default supplier). Also, there is a system setting which should be checked before reading. See other instances of the call to SupplierInfo.ReadRecord().
When a sales order line is added, the .SupplierInfo is not read in. Only after saving and re-reading the sales order do the lines get their .SupplierInfo details populated.