Scripting

  • 1.  I have a simple script that basically pushes the s

    Posted 05-01-2016 21:55
    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


  • 2.  RE: I have a simple script that basically pushes the s

    Posted 05-02-2016 04:52
    Are the orders uploaded via VI or a BOI script?


  • 3.  RE: I have a simple script that basically pushes the s

    Posted 05-02-2016 05:26
    Jeff, they use websitepipeline so its the WSP driver that brings in the order. I'm guessing it's BOI


  • 4.  RE: I have a simple script that basically pushes the s

    Posted 05-02-2016 05:50
    If that is the case, you should reach out to them to change their code to invoke your script.


  • 5.  RE: I have a simple script that basically pushes the s

    Posted 05-02-2016 05:57
    You could try another trigger. We generally trigger on the PostVal on the OrderType to set dates.


  • 6.  RE: I have a simple script that basically pushes the s

    Posted 05-02-2016 21:12
    @MichaelNottoli thank you, but I just tried changing it the trigger to Post Val on the Order Date, and then tried Order Type and finally Customer Number. None of them seem to fire off the script when it's coming form WSP