Sage 100

 View Only
  • 1.  Have any examples of date-manipulation functions in Scripting?

    Posted 12-11-2023 11:15

    Does anyone Have any examples of date-manipulation functions in Scripting?

    I need to calculate days-back from a current date in a script.



    ------------------------------
    Lee Graham
    Friendly Systems, Inc.
    ------------------------------


  • 2.  RE: Have any examples of date-manipulation functions in Scripting?

    Posted 12-11-2023 12:02

    https://communityhub.sage.com/us/sage100/f/business-object-interface/152744/script-not-working-correctly/399707 



    ------------------------------
    Kevin Moyes
    Technical Systems Analyst
    Munjal White Consulting Co.
    Toronto ON
    ------------------------------



  • 3.  RE: Have any examples of date-manipulation functions in Scripting?

    Posted 12-14-2023 09:37

    Kevin,

         That solved the mystery,

    Thanks



    ------------------------------
    Lee Graham
    Friendly Systems, Inc.
    ------------------------------



  • 4.  RE: Have any examples of date-manipulation functions in Scripting?

    Posted 12-15-2023 01:55
    This code snippet converts the module date into a format that can be used with the DateAdd function and returns it to a different MAS 90 date field.
    r = oSession.FormatDate(oSession.ModuleDate, tmpDate, "%M/%D/%Y") ' format today's date VB style
    tmpDate = DateAdd("d", 90, tmpDate) ' add 90 days to today
    tmpDate = oSession.GetFormattedDate(CStr(tmpDate)) ' put date back in MAS90 format
    r = oBusObj.SetValue("ShipExpireDate$", tmpDate)

    I forget to click send yesterday! 



    ------------------------------
    Dan Burleson
    Software Consultant
    Connex Software
    Corvallis OR
    541-224-6642
    ------------------------------