Form, DataWindow, Items

Administration > Add-ons > beas usability extension  > Form, DataWindow, Items

Top  Previous  Next

Introduction

 

In beas the windows are defined similar to HTML contents and are saved in a file

beas uses the form system "DataWindow", an object from the programming language "Powerbuilder" (C) Appeon, in order to achieve this. Which is similar to "Crystal".

There is a SQL designer and a Form designer available, which makes the creation on new windows very easy.

 

The Window ID is the name of the form, i.e. the file with the extension ".psr", e.g. "article_browse.psr" for the article list.

in order to open this window only the name has to be provided, e.g. in beas script: opennewwindow=artikel_browse.psr

 

 

datawindow1

 

If a window (form) is loaded, it contains a form (DataWindow) with the name dw_1

There are windows which have several forms e.g. the MRP view. These windows are then addressed with dw_2, dw_3 etc. A maximum of 7 forms can be loaded.

The name of the window is always the same as the name of the forms in dw_1

 

When a form is loaded, the SQL statement is executed and stored in the SQL container. The content of the SQL container is shown in the items of the form.

If the field content is changed it will immediately be written back (Syncronized) to the SQL container. During an update, the contents of the SQL container can be written directly back to the database.  

 

A form has the following structure:

datawindow2

 

Scripts and events are always executed within the form.

Scripts are stored in a file for this purpose: name of form in dw_1 + extension: ".src"

For validation configuration, function buttons, Item Placement Tool and universal functions it must also be specified for which window (name of the file) they apply.

 

Within a script, a field is addressed as:

 

datawindow3

 

How to change a value in the field ItemCode:

dw_1.item.itemcode.value="new value"

 

In order to determine the value, the same syntax is used

in beas Script < and > is used in order to do this

 

<dw_1.item.itemcode.value>

 

"item" is a property of dw_1. This also has other properties such as x-Position, y-Position, length, width, and much more

e.g.

dw_1.x=100 moves the form to x-Position 100

<dw_1.rowcount> returns how many result rows there are in the form

 

the "item" is however also a separate object with properties. e.g. "value" is the content

Other elements are: x, y, width, color etc.

dw_1.item.itemcode.x=1000 moves the field to the x-Position 1000 within the form

 

A list can contain several result rows. The line number must be specified accordingly

this is done with the following syntax (beas script):

 

<dw_1.item.itemcode:[line number].value>

 

e.g. for line 5

<dw_1.item.itemcode:5.value>

 

Variables should be enclosed in brackets

e.g.

setvar=linenumber=5

messagebox=<dw_1.item.itemcode:[linenumber].value>

 

 

Formatting

If a field should be inserted into a SQL statement, it must be formatted.

Formatting is defined as follows:

<dw_1.item.itemcode:[linenumber].value,format>

 

The following formats must be used in the SQL statements:

Format

Syntax

Example

String

dbstring

select * from "OITM" where "ItemCode"=<dw_1.item.itemcode.value,dbstring>

Number

num(x)

update U_myTable set "Quantity"=<dw_1.item.quantity.value,num(6)>

Datte

dbdate

update U_myTable set DeliveryDate=<dw_1.item.deliverydate,dbdate>

 

Within the script another formatting takes place

Format

Syntax

Example

String


if <dw_1.item.itemcode.value> = "A001" then

  ...

end if

Number

#0.000000

if <dw_1.item.quantity.value,#0.000000> n> 10 then

  ...

end if

Datte

yyyy/mm/dd

if <dw_1.item.deliverydate.value,yyyy/mm/dd> < <today,yyyy/mm/dd> then

   ....

end if

 

How can a field name be determined in a form?

There are several options to do this:

Go to: View > System Information (Ctrl + Shift + i).

 

If this is active: Right-click > Tab debug_info_icon .

Here the field name can be copied to the clipboard.

 

debug_fieldinfo1

 

Or in the opened debug window 2: click on the Item-tab, hold the Ctrl key and place the cursor over the corresponding field, then release the Ctrl key:

Debug_item


Help URL: https://help.beascloud.com/beas202106/index.html?form_dw_item.htm