Displays a message box or message in the foot line.
messagebox("text")
messagebox("type","text")
messagebox("type","id","text")
messagebox("type","id","text",{"placeholder"})
messagebox({object},{"placeholder"})
Error message in statusBar
|
Error message saved in error system and displayed in statusBar or separate message, if statusBar not existing (example Terminal window)
messagebox("error","Hello World");
messagebox("error","id","Hello <name>",{name:"James Bond"}

|
Info message in statusBar
|
messagebox("info","Hello World");

|
Ok message in statusBar
|
messagebox("ok","Hello World");

|
Simple popup message
|
messagebox("hello world");

|
Messagebox with Placeholder
|
messagebox("","","Hello <name> Today is <today,dddd dd mmmm yyyy>, <now,hh:mm am/pm>",
{name:"James Bons"});

|
Extended Messagebox
In follow variant you can create a complex messagebox
messagebox({"popup"=true,"parameter"="...","parameter"="..."})

Follow properties are available
Property
|
Description
|
type
|
Type
|
Description
|
error
|
Error message in foot-line (popup=false)
or with ERROR Icon (popup=true)
|
sql
|
SQL message
(SQL-Code and SQL-Errtext) in foot line
|
info
|
Blue message in foot-line (pupup=false)
Or with INFO Icon (popup=true)
|
ok
|
ok message in the foot line (popup=false)
or with OK Icon (popup=true)
|
question
|
With a Yes / No Question.
Insert automatically Button 1 and Button 2
Return value beas Script
if (messagereturnvalue == 1) {
// yes script
}
if (messagereturnvalue == -1) {
// no script
}
Example
messagebox({type:"question",text:"Can i help you?",modal:true,popup:true,title:"Question Message"});
if (messagereturnvalue == 1) alert("yes");
if (messagereturnvalue == -1) alert("no");

Return value PowerScript
No = -1, Yes = 1
Question with additional buttons
With follow script you can create a question box with more then two Buttons

setvar ls_cancel="no";
messagebox({type:"question",popup:true,text:"Start calculation",
yestext:"Foreground",
notext:"Background",
yes:"b1",no:"b2",
button1:"cancel",
button1command:"parent.setvar=ls_cancel=yes<linefeed>form.close"});
if (ls_cancel == "yes")
alert("action canceled");
else if (messagereturnaction == "b1")
alert("function for forground calculation");
else if (messagereturnaction == "b2" )
alert("function for background calculation");
|
questino-no
|
Like Question but default = No
|
text
|
Return the translated Text in variable value
|
|
id=xx
|
Id of Message
Use this, to define unique ID (Better support) and for translation in other language
|
text
|
Errortext of Message
Line Feed
Normal text: <cr_lf>, html: <br />)
if you insert the placeholder <body> then beas will display the text in html-format
if you don't set a <html> beas will insert <html> at begin and end of the string
if you don't set a <style> between <html> and <body> then beas will insert a standard-style
Example
messagebox({text:"<body>hello<linefeed>world</body>"})
|
popup=true
|
Use a separat Window for output the Message
Standard: off
if you set the placeholder "<body>" in the text, beas will be set the popup-Value to true
|
shared
|
Display Message and continue the program
otherwise the current program is waiting (modal - only for current window)
|
noalert
|
|
title
|
Title of the popup window
|
button1 ... button4
|
Set button 1 (the second button)
with button1command you can set the function to execute
linefeeds=<linefeed>
You need command "form.close" to close the message
Note: Current not supported
Example
messagebox({popup:true,text:"Button Click Test",button1:"Hello world",
button1command:"script"});
|
topic
|
Link to help (topic id)
only beas own documentation. For link to another documentation or internet pages, use button command
|
setup
|
link to configuration wizzard
|
bitmap
|
Bitmap of the left top side
Error: bmp/gfx/big_cancel
info: bmp/gfx/big_ok
question: bmp/gfx/big_question
Example
messagebox({bitmap:"bmp\\gfx\\big_advertising.png",popup:true,text:"Hello, important message!")

|
yes / no
|
set value for messagereturnaction
Example Beas Script
messagebox("question",{popup:true,text:"Is this ok",yes:"yesanswer",no:"nowanswer"});
messagebox("Answer = <messagereturnaction> : <messagereturnvalue>");
Result is
Button Yes: yesanswer : 1
Button No: noanswer : -1
|
yestext
notext
|
you can overwrite the text for button "OK" and "Cancel"
messagebox("question",{popup:true,text:"Is this ok",yestext:"All ok",notext=2Not ok"});
|
readcheck=id
|
Use this, if you give the user the possibility to ignore this message in future
The id must be unique and can be same number as id property
messagebox({popup:true,text:"This is my warning message",readcheck:"beas0001"});

if the User click on "do not show anymore", then beas don't open the message again
This is user-database related.
If you want that the User see all messages again:
- open SAP User - Setup
- choose the User
- right click
- show disabled messages

Info
Don't use beas as prefix. Use own company name as prefix for the id
|
|
if keyword "<html>" or "<body> inside the message text, beas display the text in an internet explorer window
if you don't define <body>, beas use HTML Standard format
if you define only <body>, beas use own CSS Style
messagebox=info$popup=true<tab>text=<body>Hello world</body>

You can use every html style and can create html tables
let htmltext=`
<i>Hello</i>, this is a <b>good</b> example<br />
<small>I like this type of messages</small>\
<table border=2>
<tr><td>ItemCode</td><td>Description</td></tr>`;
// Create a datastore and read first 10 items
// add this with table attributes to the variable htmltext
let d=sqlStatement.execute(select top 10 "ItemCode","ItemName" from "OITM" order by "ItemCode");
for (let ll_loop=1;ll_loop < d.rowcount();ll_loop++)
htmltext += "<tr><td>"+d.itemcode[ll_loop]+"</td><td>"+d.itemname[ll_loop]+"</td></tr>";
// add end of table
htmltext+="</table>";
// and display this. Use keyword <body>
messagebox({type:"ok",popup:true,text:"<body>"+htmltext+"</body>"});

Working with pictures
In Background we don't have a WEB Server. All is files based
We need always full path form local system or complete network path
Attribute to display pictures
<img src="pic_trulli.jpg">
let htmltext="Example with picture<br/><img src=\""+file.homeFolderPath+"bmp\\gfx\\big_time.png\">";
messagebox({popup:true,text:"<body>"+htmltext+"</body>"});

|
|
With the message id you can define every message as unique id
In translation system you can define the translation per language and id
Standard messages:
in file [homefolder]\program\language_e.src you can find the complete translation table
in area "M:[id]" you can see the message id's and on right side the Text
Example: M:feinb1 = Item <art_id> does not exist!
You can use it with
messagebox("info","feinb1","",{art1_id:"Sofa001"})
But for better reading of source code
messagebox("info","feinb1","Item <art_id> does not exist",{art1_id:"Sofa001"})
Own translation
For customizing multilanguage you can define own translation table
AddOn Administration (beas) -> Edit -> Language -> Edit Message -> Define Language, Meessage No and Message text

Now you can use it
As example we use german text and user interface is current english
messagebox({id:"beas0001",popup:true,text="Verwende nicht den Artikel <ls_itemcode>"},{ls_itemcode="Sofa001"});

or as simple variant - in bottom line
messagebox("info","beas0001","Verwende nicht den Artikel <ls_itemcode>",{ls_itemcode:"Sofa01"});
|
with (properties) after message type you can define additional log entries
messagebox("error(propertie,propertie2)","message");
shortprotocol
|
beas create a short protocoll in extra / system / protocoll and a short version in help/suport
|
longprotocol
|
beas create a short protocoll in extra / system / protocoll and a long version in help/suport
|
errorprotocol
|
beas create a protocoll as error-protocoll in help/support / report
|
Example
messagebox("error(shortprotocol)","This is my next with copy in shortprotocol");
|