NewForm

Open new window

 

if first parameter is an object, the system opens a completely new window.

The second parameter defines the standard parameter in the same way as when opening existing window, example {modal:true}

 

window.openform({window definition},{window open parameter});

 

 

Example:

own simple form with checkbox

complex create work order form

 

First Object parameter:

window.openform({window definition},{window open parameter});

 

Type

Description

s_parm1 - s_parm5

c_parm1 - c_parm5

dt_parm1 - dt_parm2

Define all str_parm variables.  

Example: Open item window: s_parm1 present the item code

List of all str_parm parameter see str_parm object

dwname

Define the internal window name (normally this is the psr file name, but we do not have the psr file name)

It is mandatory to define this, otherwise customization is not possible in the new window.

If the dwname is not defined, the system automatically creates a unique name.

form

textDistance

Distance between text and columns for new.

textLeft

Distance between left border and text field for new window in edit style.

style

Define style: browse or edit

update

Activate the update property.

title

Define title of the window.

sql

The new window needs a datastore in the backend. With a SQL statement it is possible to define this.

The system will display the result as window. If you want to create only empty fields, use

sql:"select space(50) as itemname,0 as number from BEAS_DUMMY"

The result is always 1 line.

function

Declare a function for the created window:

function=new function functionname() {Script}

 

Example:

let b=application.openform({dwname:"MyWindow",

 
function:new function form_loaded() {
dw_1.item.itemname.value="Hello";
} ,

 
sql:"select getdate() as mydate,space(50) as itemcode, space(100) as itemname from BEAS_DUMMY",
{modal:true });
alert(b);