Regarding your question about allocating Lots via scripting, you can try the following code but you will need to figure out how you are going to supply the lots but this should give you a foundation for distributing the lots via scripting.
_______________
```vb
sValidItemTypes = """"""5"""",""""6""""""
sItemCode = """" : oBusObj.GetValue ""ItemCode$"", sItemCode
nQuantityOrdered = 0 : oBusObj.GetValue ""QuantityOrdered"", nQuantityOrdered
nQuantityShipped = 0 : oBusObj.GetValue ""QuantityShipped"", nQuantityShipped
sItemValuation = """" : oBusObj.GetValue ""Valuation$"", sItemValuation
If InStr(sValidItemTypes, """""""" & sItemValuation & """""""") > 0 Then
nRetval = 0 : nRetval = oBusObj.SetValue(""QuantityShipped"", 0)
nRetval = 0 : nRetval = oBusObj.SetValue(""QuantityShipped"", nQuantityOrdered)
nLineDistributionBalance = 0 : nLineDistributionBalance = nQuantityOrdered
nInvoiceLineDistributionBus = 0 : nInvoiceLineDistributionBus = oBusObj.Distribution
If nInvoiceLineDistributionBus > 0 Then
Set oInvoiceLineDistributionBus = oSession.AsObject(nInvoiceLineDistributionBus)
nRetval = 0 : nRetval = oInvoiceLineDistributionBus.AddDistributionLine(""YourLotNumber"")
nRetval = 0 : nRetval = oInvoiceLineDistributionBus.Write()
nLineDistributionBalance = oInvoiceLineDistributionBus.Balance
Set oInvoiceLineDistributionBus = Nothing
End If
If nLineDistributionBalance > 0 Then nRetval = 0 : nRetval = oBusObj.SetValue(""QuantityShipped"", 0)
End If
```
_______________