Any scripting gurus out there who happen to know how i can write to a UDF in SO_SalesOrderHistoryHeader using BOI.
I've seen examples of writing to AR_InvoiceHistoryHeader but can't find one for SO_SalesOrderHistoryHeader.
I'm using the following code from the button ""Link 1"" on a dialogue panel attached to Sales Order and Quote History Inquiry (I have also tried from a button script on Sales Order Entry and same results)
____________________________
nRetval = 0
sRetval = """"
nRetval = oScript.SetUIControl(""UDF_PROJECT"", ""UNLOCK"")
nRetval = oScript.SetUIControl(""UDF_PROJECT"", ""ENABLE"")
sNewProject = """"
nRetval = oBusObj.GetValue(""UDF_PROJECT$"", sNewProject)
nRetval = oSession.SetProgram(oSession.LookupTask(""SO_SALESORDER_UI""))
oSession.LastErrorMsg = """"
nSOHistoryBus = 0
nSOHistoryBus = oSession.NewObject(""SO_SalesOrderHistoryInquiry_Bus"")
'sRetval = oSession.AsObject(oSession.UI).MessageBox("""", ""nSOHistoryBus: "" & nSOHistoryBus & vbCrLf & ""Last Error Msg: "" & oSession.LastErrorMsg)
nRetval = oScript.DebugPrint(""nSOHistoryBus: "" & nSOHistoryBus & "" | "" & ""Last Error Msg: "" & oSession.LastErrorMsg)
If nSOHistoryBus > 0 Then
Set oSOHistoryBus = oSession.AsObject(nSOHistoryBus)
sKey = """"
sKey = oBusObj.GetKeyPadded()
oSOHistoryBus.LastErrorMsg = """"
nRetval = oSOHistoryBus.SetKey(sKey)
'sRetval = oSession.AsObject(oSession.UI).MessageBox("""", ""Key: "" & sKey & vbCrLf & ""nRetval: "" & nRetval & vbCrLf & ""Last Error Msg: "" & oSOHistoryBus.LastErrorMsg)
nRetval = oScript.DebugPrint(""Key: "" & sKey & "" | "" & ""nRetval: "" & nRetval & "" | "" & ""Last Error Msg: "" & oSOHistoryBus.LastErrorMsg)
If nRetval = 1 Then
oSOHistoryBus.LastErrorMsg = """"
nRetval = oSOHistoryBus.SetValue(""UDF_PROJECT$"", sNewProject)
'sRetval = oSession.AsObject(oSession.UI).MessageBox("""", ""nRetval: "" & nRetval & vbCrLf & ""Last Error Msg: "" & oSOHistoryBus.LastErrorMsg)
nRetval = oScript.DebugPrint(""nRetval: "" & nRetval & "" | "" & ""Last Error Msg: "" & oSOHistoryBus.LastErrorMsg)
oSOHistoryBus.LastErrorMsg = """"
nRetval = oSOHistoryBus.Write()
'sRetval = oSession.AsObject(oSession.UI).MessageBox("""", ""nRetval: "" & nRetval & vbCrLf & ""Last Error Msg: "" & oSOHistoryBus.LastErrorMsg)
nRetval = oScript.DebugPrint(""nRetval: "" & nRetval & "" | "" & ""Last Error Msg: "" & oSOHistoryBus.LastErrorMsg)
End If
End If
____________________________________________
Any ideas?
Will this only work from an external BOI script?