Sounds like you need to either refresh the window or refresh the object once your script changes the value of $$errmsg.
Hi and thanks.
I sounded right.
I must remember that. Just the opposite as a table::field (e.g. if triggered to execute the Upper function).
There are two ways: Go to Layout *and* Refresh Object - or - Refresh Window
I don't recommend go to layout. Executing that step might trip any number of other script triggers that then kick in and run when you don't want them to.
OnLayoutEnter, OnRecordLoad, OnObjectExit are just a few triggers that might be tripped when executing Go To Layout.
Refresh Object is really the best option here as it will update the displayed value the most quickly.