I leave SAGE up to keep a program up and running to import orders (Insynch), I have a script looking at the system date to populate a UDF date field when a sales order is put into process. I am noticing that I haven't had to restart the SAGE application since Sunday 4/23 so the script is populating the udf with the 4/23 date for orders being processed today. Whats the best way to edit the script to get the correct date?
rVal = 0 nRec = 0 nPull = 0 nUnits = 0 nTotal = 0 sType = "" dToday = "" rVal = oBusObj.GetValue("OrderType$", sType) if sType = "S" Or sType = "B" then rVal = oBusObj.GetValue("UDF_TOTAL_QTY_REC", nRec) rVal = oBusObj.GetValue("UDF_TOTAL_QTY_PULLED", nPull) rVal = oBusObj.GetValue("UDF_UNIT_COUNT", nUnits) nTotal = nRec+nPull if nTotal = nUnits then rVal = oBusObj.SetValue("UDF_ALLOCATED$", "Y") rVal = oSession.FormatDate(oSession.SystemDate, dToday, "%M/%D/%Y") dToday = oSession.GetFormattedDate(CStr(dToday)) rVal = oBusObj.SetValue("UDF_DATE_ALLOCATED$", dToday) end if end if