Placeholder are the best possibility to work quick and easily with the data-content of the current form. Placeholders are specified between < and >
BEAS checks the placeholder origin:
- edit-field of the current window (if variable does not start with <%var("variable")> )
- default placeholder
- str_parm-object
- instance-variable (setvar=..)
- object-variable initialised with declare
Example
// output current date
setvar=myvar=today is <today>
// output name from item
input=please input itemcode:=myitem==cancel
select itemname from oitm where itemcode='<myitem>'
message=itemname from item <myitem>: <wert1>
Be careful with different formatting of digits and datetimes:
numeral: <myvalue,dbnum> date: <mydatevalue,dbdate> String: <mystringvalue,dbstring>
example update "MyTable" set "MyNumber"=<lc_onhand,dbnum>,& "MyDate"=<ldt_mydate,dbdate>,& "MyString"=<ls_string,dbstring>
More see select |
|
Calculation in beas-Script or call of beas-functions |
numeral: <myvalue,#0.000000> date: <mydatevalue,yyyy/mm/dd> |
Display |
numeral to string: <myvalue,#,##0.000000> Date: <mydatevalue> |
Special behaviour when using a SQL command as placeholder: Because the SQL-command also uses the < and > you have to put in placeholders between { and }. The SQL-command itself is not allowed to have a < or >
Placeholders can be combined with other Placeholder-commands
message=Name of this day is: %dayname(<today>)
There are a lot of "default-placeholders" returning a calculated or depending value. You can also access the DataWindow and the str_parm. More information see "placeholder, variables"
Date and numeral values often have to be converted, e. g. <menge,#,#0.00>. More information about formatting see "placeholder formatting"
Variables are double converted
Example: value from variable
setvar=test="<today>"
setvar=ls_result=<test> => in result is current date and not "<today>"
In this case use <%var("test")> . This command is faster!
setvar=ls_result=<%var("test")> => in result is current date and not "<today>"
to move a field value from one to other columns, use the transfer command