I have a simple test script that I wrote based on a script that Elliott posted a couple of years ago
oTest = 0
Set oTest = oSession.AsObject(oSession.GetObject("CM_UDTMaint_bus", "SY_UDT_SY_TEST"))
dateStamp = ""
timeStamp = ""
userKey = ""
retVal = oSession.GetStampInfo(userKey, dateStamp, timeStamp)
company = oSession.CompanyCode
Randomize
key = company & "_" & dateStamp & "_" & timeStamp & "_" & Rnd
retVal = oTest.SetKey( key )
If retVal > 0 Then
table = oBusObj.GetTable( "MAIN" )
state = oBusObj.EditState
retVal = oTest.SetValue("UDF_Company$", company)
retVal = oTest.SetValue("UDF_Table$", table)
retVal = oTest.Write()
End If
If I put this script on the Post Write event for say AR Customer Master, or SO Sales Order Header, it fires as expected. If i put it on the AR Invoice History Header or AR Open Invoice it doesn't fire when I update the sales journal. I know there are some tables that get written to directly, bypassing the business object, but this should work, shouldn't it?