The object represents a temporary form for retrieving information from the user.
Availability The object is returned by a method or a property of another object
form = program.newdataform()
form.settitle("Find customer")
form.addfieldtext("Name","NAMECUSTOMER","")
form.show()
if form.closewithx == true then
--exit to script
do return end
end
table = database.getsql("SELECT * FROM customer WHERE nome='" .. form.getvalue("NAMECUSTOMER") .. "'")
if table.countrows() > 0 then
program.showconfirm("Customer found")
else
program.showerror("Customer not found")
end
addfielddate
Description Adds a field for entering a date Value Type Format dataform.addfielddate(caption, tag, defaultvalue) Type Method Systems Windows, Web, Android, IOS, Mac OS
Parameter Value Type Description caption string Represents the field label tag string Represents the unique identifier of the field to retrieve or set its value defaultvalue object The default value to be set during the creation of the field
Examples
dataform.addfielddate("Start Date","start",utility.getnow())
addfieldinteger
Description Adds a field for entering an integer number Value Type Format dataform.addfieldinteger(caption, tag, defaultvalue) Type Method Systems Windows, Web, Android, IOS, Mac OS
Parameter Value Type Description caption string Represents the field label tag string Represents the unique identifier of the field to retrieve or set its value defaultvalue object The default value to be set during the creation of the field
Examples
dataform.addfieldinteger("Number of days","numberday",1)
addfieldlist
Description Adds a field for selecting a value from a defined list Value Type Format dataform.addfieldlist(caption, tag, values, defaultvalue) Type Method Systems Windows, Web, Android, IOS, Mac OS
Parameter Value Type Description caption string Represents the field label tag string Represents the unique identifier of the field to retrieve or set its value values list<string> The strings that will populate the list defaultvalue object The default value to be set during the creation of the field
Examples
dataform.addfieldlist("Select Day","selectday",{"Monday","Tuesday","Wednesday"},"Monday")
addfieldnumber
Description Adds a field for entering a number with decimals Value Type Format dataform.addfieldnumber(caption, tag, defaultvalue) Type Method Systems Windows, Web, Android, IOS, Mac OS
Parameter Value Type Description caption string Represents the field label tag string Represents the unique identifier of the field to retrieve or set its value defaultvalue object The default value to be set during the creation of the field
Examples
dataform.addfieldnumber("Quantity","qty",1.5)
addfieldtext
Description Adds a field for text input Value Type Format dataform.addfieldtext(caption, tag, defaultvalue) Type Method Systems Windows, Web, Android, IOS, Mac OS
Parameter Value Type Description caption string Represents the field label tag string Represents the unique identifier of the field to retrieve or set its value defaultvalue object The default value to be set during the creation of the field
Examples
dataform.addfieldtext("Customer name","name","Bob")
closewithx
Description Indicates if the dataform has been closed with the x Value Type boolean Format boolean = dataform.closewithx Type Property Systems Windows, Web, Android, IOS, Mac OS
getvalue
Description Retrieves a value Value Type object Format object = dataform.getvalue(tag) Type Method Systems Windows, Web, Android, IOS, Mac OS
Parameter Value Type Description tag string Represents the unique identifier of the field from which the value will be retrieved
Examples
value = dataform.getvalue("name")
setheight
Description Sets the height of the dataform in pixels Value Type Format dataform.setheight(height) Type Method Systems Windows, Web, Android, IOS, Mac OS
Parameter Value Type Description height integer Represents the value of the dataform height
Examples
dataform.setheight(300)
settitle
Description Sets the title of the dataform Value Type Format dataform.settitle(title) Type Method Systems Windows, Web, Android, IOS, Mac OS
Parameter Value Type Description title string The title of the dataform
Examples
dataform.settitle("Select date")
setvalue
Description Sets the value of a field in the dataform Value Type Format dataform.setvalue(tag, value) Type Method Systems Windows, Web, Android, IOS, Mac OS
Parameter Value Type Description tag string Represents the unique identifier of the field on which the value will be set value object The value that will be set in the field
show
Description Shows the dataform Value Type Format dataform.show() Type Method Systems Windows, Web, Android, IOS, Mac OS