LUA object: datarow

The object represents a new or saved record of a table in the database. It identifies a specific data row belonging to a datatable or tableview object.

AvailabilityThe object is available only in specific execution contexts, or is created by a function provided by other objects
Pre-initialized inRow added to a data table, Pre-save of data table row, Counter acquisition for a data table row, Post-save of data table row, Pre-move of data table row to recycle bin, Row restored from recycle bin, Pre-deletion of data table row, Post-deletion of data table row, Row action on a data table, Value changed in a data table row cell
table = database.getsql("SELECT * FROM customers WHERE nation ='italy'")
nrows = table.countrows()
rows = table.getrows()

for i = 1, nrows do
   customername = rows[i].getvalue("name")
   output.print(customername)
end

getvalue

DescriptionRetrieves the value of a specific field present within the datarow
Value Typeobject
Formatobject = datarow.getvalue(columnname)
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
columnnamestringThe name of the field from which to retrieve the value
Examples
value = datarow.getvalue("name")

save

DescriptionSaves the values present in the record inside the database
Value Typeboolean
Formatboolean = datarow.save()
TypeMethod
SystemsWindows, Web, Android, IOS, Mac OS
Examples
bool = datarow.save()

setvalue

DescriptionSets the value of a specific field present within the datarow
Value Type
Formatdatarow.setvalue(columnname, value)
TypeMethod
SystemsWindows, Web, Android, IOS, Mac OS
ParameterValue TypeDescription
columnnamestringThe name of the field where to save the value
valueobjectThe value to be saved inside the field
Examples
datarow.setvalue("name","Bob")

tablename

DescriptionThe name of the table that the datarow belongs to
Value Typestring
Formatstring = datarow.tablename
TypeProperty
SystemsWindows, Web, Android, IOS, Mac OS