Sage 100

 View Only
  • 1.  Script for MessagBox to display on client, not server

    Posted 02-06-2019 12:28
    Am I correct in thinking that the "messagebox" function will display the message box on the client in a Sage 100 Advanced environment?
    My understanding is the other function "msgbox" only shows on the server in the advanced environment.

    ------------------------------
    Clark Walliser
    Senior Consultant
    DSD Business Systems
    San Jose CA
    Clark
    ------------------------------


  • 2.  RE: Script for MessagBox to display on client, not server

    Posted 02-06-2019 12:32
    Edited by Kevin Moyes 02-06-2019 12:33
    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
    ------------------------------



  • 3.  RE: Script for MessagBox to display on client, not server

    Posted 02-06-2019 12:50
    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
    ------------------------------



  • 4.  RE: Script for MessagBox to display on client, not server

    Posted 02-06-2019 13:00
    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
    ------------------------------



  • 5.  RE: Script for MessagBox to display on client, not server

    Posted 02-06-2019 13:05
    Thanks Kevin, that helps a lot.
    Now to see what I can do with it... :)

    ------------------------------
    Clark Walliser
    Senior Consultant
    DSD Business Systems
    San Jose CA
    Clark
    ------------------------------