Anyone have any experience with firing scripts when using StarShip to invoice or have orders automated from the web using Website Pipeline? I have a script adding a misc charge in SO Entry & SO Invoice Entry, but when an order comes from the web into SO Entry, it doesn't populate. When an invoice comes from StarShip, it doesn't populate. I've tried Pre-Totals, Pre-Write, Post-Write, but nothing is working. If I manually enter in either place, it works.
sItemType = """"
sItemCode = """"
s301 = """"
Ext = 0
TotExt = 0
Tariff = 0
Set oLines = oBusObj.AsObject(oBusObj.Lines)
retVal = oLines.MoveFirst()
Do Until CBool(oLines.EOF) = True
retVAl = oLines.GetValue(""ItemCode$"", sItemCode)
If sItemCode = ""/301TARIFF"" then
retVal = oLines.Delete()
End If
retVal = oLines.MoveNext()
Loop
retVal = oLines.MoveFirst()
Do Until CBool(oLines.EOF) = True
retVal = oLines.GetValue(""ItemType$"", sItemType)
retVal = oLines.GetValue(""UDF_301_TARIFF$"",s301)
If sItemType = ""1"" and s301 = ""Y"" then
retVal = oLines.GetValue(""ExtensionAmt"",Ext)
TotExt = TotExt + Ext
End If
retVal = oLines.MoveNext()
Loop
Tariff = TotExt*.25
retVal = oLines.AddLine()
retVal = oLines.SetValue(""ItemCode$"", ""/301TARIFF"")
retVal = oLines.SetValue(""ExtensionAmt"", Tariff)
retVal = oLines.Write()