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.

  • Sales Order Options, tab 2 Entry. Set the Quote Expire to 30 days. The Ship/Expire date field will then be set to 30 days from today.  Elliot would know for sure.

  • in reply to BigLouie

    BL, I think that setting just applies to Quotes and not standard orders.

  • in reply to zip

    It's certainly worth testing since it's the same field.

  • in reply to Kevin M

    I don't think that is what I want, since I don't want my quotes to expire every 30 days. I ended up going into Sales Order Entry, then the Default button and was able to change the Ship Date to 10/1/2021 since that would be a month from now. I'm not sure if that will update tomorrow to 10/2/2021 but I was going to check in the morning. Even if I can't, setting a reminder to change the default once every morning would still be better than remembering to change the ship date every order I enter. Thanks though.

  • in reply to Jerrad Garrett

    You can also script the logic, if you know how to write User Defined Scripts.  For one customer we have a pop-up warning when saving if the ShipDate and OrderDate are the same.

  • in reply to Kevin M

    Where would you go to write the script? Is it something like Excel VBA where it's built into the program?

  • in reply to Jerrad Garrett

    In the Custom Office module. You write a script (VBScript using the BOI) and attach it to an event trigger.

    There are lots of script examples in Sage City posts to get you started if you want to learn.

  • in reply to Kevin M

    Although having it automatically set a month out for me would be nice, just having the pop-up like you mentioned would be good enough and would probably prevent less room for error in the script. Could you easily change your script to account for all customers? If so, is there any way I could get this script off of you? If not, I understand but it would probably save me a lot of time haha.

  • in reply to Jerrad Garrett

    That specific script has more features than I mentioned, but I'll give this away because it's not too complex.  (Normally I don't post complete scripts because selling such things is how I make a living... plus it encourages people to learn themselves, which is what this kind of forum is all about).

    Untested, so there may be a typo.  Be sure to enable Allow External Access in Company Maintenance.

    retVal = 0
    sOrderDate = "" : sShipDate = ""
    retVal = oBusObj.GetValue("OrderDate$", sOrderDate)
    retVal = oBusObj.GetValue("ShipExpireDate$", sShipDate)
    
    if oSession.UI <> 0 and sShipDate = sOrderDate then
    	retVal = oSession.AsObject(oSession.UI).MessageBox("Ship Date = Order Date")
    end if

    Add the script using UDS maintenance, save, then add the trigger (using the created UDS) on SO header's "PreWrite" event using UDF/UDT maintenance.

  • in reply to Kevin M

    This works perfectly, I greatly appreciate it. I was trying to work it out by myself before you replied but could not get the syntax down. I'm pretty new to coding and scripting so even Excel VBA takes me a while to figure out. Personally, I learn more seeing code like this and going through each line and attaching it to some kind of logic and using it for later reference, rather than trying to write the code myself the first time. Once I put this in place, will everyone in my company get this box pop-up every time they make a Sales Order with the same Ship Date and Order Date?