LUA object: dataview

The object represents a data form.

AvailabilityThe object is available only in specific execution contexts, or is created by a function provided by other objects
Pre-initialized inNew data form, Data form opened, Pre-save of data form, Counter number acquisition for a data form, Post-save of data form, Pre-move of data form to recycle bin, Post-move of data form to recycle bin, Pre-deletion of data form, Post-deletion of data form, Data form restored from recycle bin, Pre-print of data form, Post-print of data form, Action on data form, Button on data form, Action on data form print, Data form closed, Value being edited on data form, Value changed on data form, Pre-archiving of data form, Post-archiving of data form
newcustomer = program.newdataview("customer","")
newcustomer.setvalue("name","Davide")
newcustomer.setvalue("surname","Sbreviglieri")
newcustomer.save()

actionenable

DescriptionEnables or disables the actions button on the form
Value Typeboolean
Formatboolean = dataview.actionenable
TypeProperty
SystemsWindows, Web, Android, IOS, Mac OS

backcolorvalue

DescriptionSets the background color of a specific field on the form
Value Type
Formatdataview.backcolorvalue(fieldname, color)
TypeMethod
SystemsWindows, Web, Android, IOS, Mac OS
ParameterValue TypeDescription
fieldnamestringThe name of the field to which to apply the color
colorintegerThe color in integer format to be applied to the field
Examples
dataview.backcolorvalue("name",-65536)

captionsave

DescriptionChanges the label of the save button
Value Type
Formatdataview.captionsave(value)
TypeMethod
SystemsWindows, Web, Android, IOS, Mac OS
ParameterValue TypeDescription
valuestringThe value to be displayed as a label on the save button
Examples
dataview.captionsave("Save now!")

captionvalue

DescriptionModifies the label of a specific field on the form
Value Type
Formatdataview.captionvalue(fieldname, value)
TypeMethod
SystemsWindows, Web, Android, IOS, Mac OS
ParameterValue TypeDescription
fieldnamestringThe name of the field to which the label is to be modified
valuestringThe value of the label to be set
Examples
dataview.captionvalue("name","Change name customer")

createdocument

DescriptionCreates a document type object
Value Typedocument
Formatdocument = dataview.createdocument(gguidprinter)
TypeMethod
SystemsWindows, Web, Android, IOS, Mac OS
ParameterValue TypeDescription
gguidprinterstringThe unique identifier of the print that will be used to create the document
Examples
print = dataview.createdocument("YYY-YYY")

disableediting

DescriptionCompletely disables editing of all fields and additional tables in the form
Value Type
Formatdataview.disableediting()
TypeMethod
SystemsWindows, Web, Android, IOS, Mac OS
Examples
dataview.disableediting()

enablevalue

DescriptionEnables or disables editing a value by bypassing user permission checks
Value Type
Formatdataview.enablevalue(fieldname, enabled)
TypeMethod
SystemsWindows, Web, Android, IOS, Mac OS
ParameterValue TypeDescription
fieldnamestringThe name of the field to activate or deactivate
enabledbooleanThe value that sets whether the field is enabled or not
Examples
dataview.enablevalue("name",true)

forecolorvalue

DescriptionSets the text color value for a specific field on the form
Value Type
Formatdataview.forecolorvalue(fieldname, color)
TypeMethod
SystemsWindows, Web, Android, IOS, Mac OS
ParameterValue TypeDescription
fieldnamestringThe name of the field to which to apply the text color
colorintegerThe color in integer format to be applied to the field
Examples
dataview.forecolorvalue("name",-65536)

getatable

DescriptionRetrieves an additional table present in the form
Value Typetableview
Formattableview = dataview.getatable(tablename)
TypeMethod
SystemsWindows, Web, Android, IOS, Mac OS
ParameterValue TypeDescription
tablenamestringThe name of the table to retrieve among those in the form
Examples
rows = dataview.getatable("orders_rows")

getvalue

DescriptionRetrieves the value of a field present or hidden on the form
Value Typeobject
Formatobject = dataview.getvalue(fieldname)
TypeMethod
SystemsWindows, Web, Android, IOS, Mac OS
NotesIf a column name that does not exist is entered, the method returns an empty string
ParameterValue TypeDescription
fieldnamestringThe name of the field from which to retrieve the value
Examples
value = dataview.getvalue("name")

gguid

DescriptionThe unique identifier of the record currently loaded in the form
Value Typestring
Formatstring = dataview.gguid()
TypeMethod
SystemsWindows, Web, Android, IOS, Mac OS
Examples
id = dataview.gguid()

hideallocator

DescriptionHides the tab with the value splitter calculation table, if value splitters have been set
Value Type
Formatdataview.hideallocator()
TypeMethod
SystemsWindows, Web, Android, IOS, Mac OS

hideatable

DescriptionHides or shows a specific additional table in the form
Value Type
Formatdataview.hideatable(tablename, visible)
TypeMethod
SystemsWindows, Web, Android, IOS, Mac OS
ParameterValue TypeDescription
tablenamestringThe name of the additional table to display or hide
visiblebooleanWhether the additional table should be hidden or shown

hidetabs

DescriptionHides or shows the tab bar of the form
Value Type
Formatdataview.hidetabs(visible)
TypeMethod
SystemsWindows, Web, Android, IOS, Mac OS
ParameterValue TypeDescription
visiblebooleanWhether the tab bar should be shown or not

hideuserselector

DescriptionHides the user selection list associated with the currently loaded record in the form
Value Type
Formatdataview.hideuserselector()
TypeMethod
SystemsWindows, Web, Android, IOS, Mac OS

isnew

DescriptionIndicates whether the record currently loaded in the form is new (and therefore not yet saved) or not
Value Typeboolean
Formatboolean = dataview.isnew()
TypeMethod
SystemsWindows, Web, Android, IOS, Mac OS

listatable

DescriptionRetrieves the list of names of all additional tables present on the form
Value Typelist<string>
Formatlist<string> = dataview.listatable()
TypeMethod
SystemsWindows, Web, Android, IOS, Mac OS

modatt

DescriptionIndicates whether the form has been modified and not yet saved or not
Value Typeboolean
Formatboolean = dataview.modatt()
TypeMethod
SystemsWindows, Web, Android, IOS, Mac OS

newnotification

DescriptionCreates a new notification
Value Typenotification
Formatnotification = dataview.newnotification()
TypeMethod
SystemsWindows, Web, Android, IOS, Mac OS

readbarcode

DescriptionOn mobile devices, opens the camera to scan a barcode and return its value
Value Typestring
Formatstring = dataview.readbarcode()
TypeMethod
SystemsAndroid, IOS

readmultiphoto

DescriptionOpens the camera on mobile devices, or multiple file selection on the desktop version, to load several images into a table at once
Value Type
Formatdataview.readmultiphoto(tableview, fieldname)
TypeMethod
SystemsAndroid, IOS
NotesA new row of the additional table is created for each photo taken or selected
ParameterValue TypeDescription
tableviewtableviewThe table containing the image field to use
fieldnamestringThe name of the image field that will receive the photo taken or selected

readphoto

DescriptionOn mobile devices, opens the camera to take a photo and save it within an image field
Value Type
Formatdataview.readphoto(fieldname)
TypeMethod
SystemsAndroid, IOS
ParameterValue TypeDescription
fieldnamestringThe name of the image field that will receive the taken photo

save

DescriptionSaves the form
Value Typeboolean
Formatboolean = dataview.save()
TypeMethod
SystemsWindows, Web, Android, IOS, Mac OS

saveenable

DescriptionActivates or deactivates the save button on the form
Value Typeboolean
Formatboolean = dataview.saveenable
TypeProperty
SystemsWindows, Web, Android, IOS, Mac OS

setvalue

DescriptionSets the value of a field that is present or hidden on the form
Value Type
Formatdataview.setvalue(fieldname, value)
TypeMethod
SystemsWindows, Web, Android, IOS, Mac OS
ParameterValue TypeDescription
fieldnamestringThe name of the field to which the value will be applied
valueobjectThe value that will be saved inside the field

showconfirm

DescriptionDisplays a confirmation message
Value Type
Formatdataview.showconfirm(message)
TypeMethod
SystemsWindows, Web, Android, IOS, Mac OS
ParameterValue TypeDescription
messagestringThe message to display

showerror

DescriptionDisplays an error message
Value Type
Formatdataview.showerror(message)
TypeMethod
SystemsWindows, Web, Android, IOS, Mac OS
ParameterValue TypeDescription
messagestringThe message to display

showwarning

DescriptionDisplays an alert message
Value Type
Formatdataview.showwarning(message)
TypeMethod
SystemsWindows, Web, Android, IOS, Mac OS
ParameterValue TypeDescription
messagestringThe message to display

switchdataview

DescriptionCloses the current form to open another one
Value Type
Formatdataview.switchdataview(tablename, gguidrecord)
TypeMethod
SystemsWindows, Web, Android, IOS, Mac OS
ParameterValue TypeDescription
tablenamestringThe name of the table of the form to open
gguidrecordstringThe unique identifier of the record to load in the new form

tablename

DescriptionRetrieves the name of the table of the form
Value Typestring
Formatstring = dataview.tablename()
TypeMethod
SystemsWindows, Web, Android, IOS, Mac OS

update

DescriptionForces the recalculation of all calculation expressions present in the additional tables and on the form
Value Typeboolean
Formatboolean = dataview.update()
TypeMethod
SystemsWindows, Web, Android, IOS, Mac OS