I have a column postvalidate script called when a user selects a udf field using a UDT for validation.
Essentially the script gets the returned value from the UDF lookup, then opens the UDT and gets
another value out of the table.
Table columns
UDF_MANAGER_CODE UDF_MANAGER_NAME
003 Joe
004 Bill
005 Tracy
The script works fine when you pick the first MANAGER_CODE, and inserts the UDF_MANAGER_NAME in another UDF on the form.
Here's the problem. When you return to the form and select the same UDF_MANAGER_CODE, the postvalidate script does not run.
Only if you pick a DIFFERENT UDF_MANAGER_CODE does the postvalidate script execute.
The reason it's important, is because the underlying UDT table has a new UDF_MANAGER_NAME, and I expect the postvalidate script to
run and populate the other udf field with the new value.
Kind of confusing, but my hunch is I don't exactly understand how the postvalidate logic works.
Dim manager_code
Dim manager_name
retval = 0
oUDT = 0
bugval = 0
manager_code = ""
manager_name = ""
retVal = oBusObj.GetValue("UDF_MANAGER_CODE$", manager_code)
Set oUDT = oSession.AsObject(oSession.GetObject("CM_UDTMaint_bus", "AR_UDT_ACCT_MANAGER"))
retval = oUDT.SetKey(manager_code)
if(retval = 1) then
'get value from UDT
retVal = oUDT.GetValue("UDF_MANAGER_NAME$", manager_name)
'assign value to current biz obj
retVal = oBusObj.SetValue("UDF_MANAGER_NAME$", manager_name)
end if