I have a simple script that basically pushes the ship date of an order to the next business day if the order date is entered on the weekend. The script works great on orders entered manually but nothing happens when its imported as a web order (websitepipeline). They get a lot web orders on the weekends and have to manually edit each one on Monday to push it to the next business day. Do I need to do anything special for imported orders? TIA
' Description: Calculates the Ship Date based on Order Date
' Set on SO_SalesOrderHeader Post Read-Table
shipDate = """"
ordrDate = """"
ordrtype = """"
retval = oBusObj.GetValue(""OrderType$"", ordrType)
retval = oBusObj.GetValue(""OrderDate$"", ordrDate)
retval = oSession.FormatDate(ordrDate, shipDate, ""%M/%D/%Y"")
if oSession.CompanyCode=""ABC"" and ordrType = ""S"" and oBusObj.EditState = 2 then
if Weekday(shipDate) = 7 Then ' shipdate is Saturday
shipDate = DateAdd(""D"", 2, shipDate)
ElseIf Weekday(shipDate) = 1 Then ' shipdate is Sunday
shipdate = DateAdd(""D"", 1, shipDate)
End If
shipDate = oSession.GetFormattedDate(CStr(shipDate))
retval = oBusObj.SetValue(""ShipExpireDate$"", shipDate)
end if