Yes, it will work. My tip was a general caution.
If you trigger on a BOI event (table pre-write, column post validate...) these can be executed when there is no UI (User Interface). If you import RoG, that is one thing you want to be careful of, so there is no invisible message box, locking the process thread waiting for an impossible "OK" click.
The UI check in my example above prevents this... but if you filter the whole script at a higher level, to only run for a specific
oSession.StartProgram, that could work too.
------------------------------
Kevin Moyes
Technical Systems Analyst
Munjal White Consulting Co.
Toronto ON
------------------------------
Original Message:
Sent: 02-06-2019 12:50
From: Clark Walliser
Subject: Script for MessagBox to display on client, not server
The client wants a message box to display in PO Receipt of Goods entry when the receipt date is less than X days from a previously entered UDF date.
How does this relate to your statement to be careful to not use it when "there is no UI (eg. journal update, VI job...) ?
Are you saying the messagebox function will not work in my proposed scenario?
------------------------------
Clark Walliser
Senior Consultant
DSD Business Systems
San Jose CA
Clark
------------------------------
Original Message:
Sent: 02-06-2019 12:32
From: Kevin Moyes
Subject: Script for MessagBox to display on client, not server
msgbox is a VBScript command and it will run wherever the script is being executed... not compatible with Advanced / Premium.
Use the Sage MessageBox method and it will show properly at the Client workstation... but be careful to not do use it when there is no UI (eg. journal update, VI job...).
MAS_UI = False
if oSession.UI <> 0 then
MAS_UI = True
end if
if MAS_UI then
retVal = oSession.AsObject(oSession.UI).MessageBox("Words: " & sStringVar)
end if
------------------------------
Kevin Moyes
Technical Systems Analyst
Munjal White Consulting Co.
Toronto ON