Hello everyone, I'm trying to populate 3 UDFs based off a button click to approve a Receipt of Goods. Here is the UI script I have linked to the button
'Triggered to write the date/time/name to receiver UDFs approved=PO_ReceiptOfGoodsHeader_bus_UDF_RECEIVER_APPROVED sDate="" sTime="" newDate="" sDate = FormatDateTime(Date, vbShortDate) sTime = FormatDateTime(Time, vbShortTime) retVal=oSession.FormatDate(sDate, newDate, "%M/%D/%Y") newDate=oSession.GetFormattedDate(CStr(newDate)) If approved="Y" Then retVal=PO_ReceiptOfGoodsHeader_bus.SetValue("UDF_RECEIVER_DATE$",newDate) retVal=PO_ReceiptOfGoodsHeader_bus.SetValue("UDF_RECEIVER_TIME$",sTime) retVal=PO_ReceiptOfGoodsHeader_bus.SetValue("UDF_RECEIVER_NAME$", oSession.UserCode) End If
However, when I click the button I get the following errors:
OLE Error Number: 424
Description: Object required: 'oSession'
Script Line 34 which refers to retVal=oSession.FormatDate(sDate, newDate, "%M/%D/%Y")
Any idea what I'm doing wrong?
Thanks in advance for any and all help!