want to write script and put a UDF of duration between PO order date and confirm date

SUGGESTED

error using pre-write

orderdate = ""
confirmdate = ""


retVal = oBusObj.GetValue("PurchaseOrderDate$", orderdate)
retVal = oBusObj.GetValue("UDF_PO_CONFIRMDATE$", confirmdate)

dateD = DateDiff("d", confirmdate, orderdate)
retVal = oBusObj.SetValue("UDF_CONFIRM_DATE_PASS", dateD)

Parents
  • 0

    Here is an example of how I add to dates and update a field and a UDF

    sDate=""
    Ship=""
    newDate=""
    ComText= ""
    retVal=oBusObj.GetValue("RequiredExpireDate$",sDate)
    retVal=oBusObj.GetValue("ShipVia$",Ship)
    retVal=oBusObj.GetValue("Comment$",ComText)
    retVal = oSession.FormatDate(sDate, newDate, "%M/%D/%Y")
    newDate = DateAdd("D", 25, newDate)
    newDate = oSession.GetFormattedDate(CStr(newDate))
    ComText="Incoterms 2020 Apply"
    If Ship = "OCEAN" then
    retVal = oBusObj.SetValue("UDF_HOUSTON_DATE$", newDate)
    retVal = oBusObj.SetValue("Comment$",ComText)

    End If

Reply
  • 0

    Here is an example of how I add to dates and update a field and a UDF

    sDate=""
    Ship=""
    newDate=""
    ComText= ""
    retVal=oBusObj.GetValue("RequiredExpireDate$",sDate)
    retVal=oBusObj.GetValue("ShipVia$",Ship)
    retVal=oBusObj.GetValue("Comment$",ComText)
    retVal = oSession.FormatDate(sDate, newDate, "%M/%D/%Y")
    newDate = DateAdd("D", 25, newDate)
    newDate = oSession.GetFormattedDate(CStr(newDate))
    ComText="Incoterms 2020 Apply"
    If Ship = "OCEAN" then
    retVal = oBusObj.SetValue("UDF_HOUSTON_DATE$", newDate)
    retVal = oBusObj.SetValue("Comment$",ComText)

    End If

Children
No Data