Automatically Setting Ship Date a Month Out

When creating a sales order, is there a way to automatically set the ship date a month away from today? I always seem to forget to change it and it causes a lot of problems with On-Time delivery. I was hoping there might just be a setting or something that by default will set it a month away and from there, I can change it if a customer requires a due date that is sooner.

  • in reply to Jerrad Garrett

    They have to close and reopen SO entry to load the script, but yes, it should apply to everyone.

    The trigger I recommended runs when you click Totals, not when you click Accept, so you have a chance to change the date before saving.

    Sage City has lots of code snippets, so if you need examples, read the forum history.

  • in reply to Kevin M

    I've been messing with the code a little bit today to try to get a message box if an order has a ship date older than the current date. I'd like it to pop up whether it's when I am creating an Sales Order or editing one. I don't get an error code but it doesn't give me a pop-up box. I'm not exactly sure what logic is behind "if oSession.UI <> 0" but that is the only thing I would suspect would prevent the message box from popping up. Would this be why? If not, what would be causing it? I've been looking around for something similar on the forums and can't seem to find anything about it. If this is something you wouldn't usually answer that's understandable and I don't expect you to answer it. Any help is appreciated. Thanks.

    retVal = 0
    
    sShipDate = ""
    
    retVal = oBusObj.GetValue("ShipExpireDate$", sShipDate)
    
    
    if oSession.UI <> 0 and sShipDate < Date() then
    	
    	retVal = oSession.AsObject(oSession.UI).MessageBox("Ship Date is Past Due")
    
    end if

  • in reply to Jerrad Garrett

    The oSession.UI filter is just to prevent the script from running when there is no UI (like when an order is being updated while posting an invoice batch).

    The Sage date format is different than the format for your Date() returns so you are comparing apples to oranges. 

    Search these forums for FormatDate and GetFormattedDate to learn more.

  • in reply to Kevin M

    Alright thank you for giving me some direction. I appreciate it.