The object represents the program.
| Availability | Global object, available in all scripts |
| Pre-initialized in | All scripts |
clienttype = program.type()
if clienttype == 1 then
output.print("Client windows")
else
output.print("Other client")
end
dismisspresentation
| Description | Closes a web window based on its identifier |
| Value Type | |
| Format | program.dismisspresentation(identifier) |
| Type | Method |
| Systems | |
| Parameter | Value Type | Description |
| identifier | string | The identifier of the window to be closed |
forcesync
| Description | If the current database is a cloud database, forces synchronization with the server |
| Value Type | |
| Format | program.forcesync() |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
Examples
program.forcesync()
geocoding
| Description | Given an address, the system returns the normalized address using the Google Maps service and its geographic coordinates |
| Value Type | list<list<object>> |
| Format | list<list<object>> = program.geocoding(address) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| address | string | The complete address to send |
Examples
address = program.geocoding("via genova 12,41012 Carpi Modena Italy")
geocodingreverse
| Description | Converts a latitude and longitude into a real address using the Google Maps service |
| Value Type | list<string> |
| Format | list<string> = program.geocodingreverse(lat, lng) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| lat | double | The latitude of the geographic coordinate |
| lng | double | The longitude of the geographic coordinate |
Examples
address = program.geocodingreverse(-1,-1)
geolocation
| Description | Only for mobile systems, returns the GPS coordinates of the device |
| Value Type | list<double> |
| Format | list<double> = program.geolocation() |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
Examples
coordinates = program.geolocation()
getcarttable
| Description | Retrieves the cart management table associated with a specific data table |
| Value Type | carttable |
| Format | carttable = program.getcarttable(tablename) |
| Type | Method |
| Systems | Web, Android, IOS |
| Parameter | Value Type | Description |
| tablename | string | The name of the table associated with the cart |
getownerid
| Description | Returns the unique identifier of the user who owns the current database |
| Value Type | single |
| Format | single = program.getownerid() |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
Examples
id = program.getownerid()
getownerusername
| Description | Returns the name of the user who owns the current database |
| Value Type | string |
| Format | string = program.getownerusername() |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
Examples
username = program.getownerusername()
getparam
| Description | Retrieves a value from the global space of the program based on a key |
| Value Type | object |
| Format | value = program.getparam(key) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| key | string | The key of the value |
getstringuserid
| Description | Returns the unique identifier of the current user in string format |
| Value Type | string |
| Format | string = program.getstringuserid() |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
Examples
stringid = program.getstringuserid()
getusercategory
| Description | Returns the category of the current user in bitwise format |
| Value Type | double |
| Format | double = program.getusercategory() |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
Examples
category = program.getusercategory()
getuserid
| Description | Returns the unique identifier of the current user |
| Value Type | integer |
| Format | integer = program.getuserid() |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
Examples
id = program.getuserid()
getusername
| Description | Returns the email or name of the current user |
| Value Type | string |
| Format | string = program.getusername() |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
Examples
username = program.getusername()
insertcart
| Description | For mobile versions, inserts a record reference inside the cart for order creation |
| Value Type | |
| Format | program.insertcart(tablename, gguid, gguidvariant, qta) |
| Type | Method |
| Systems | Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| tablename | string | The table containing the record to be inserted into the cart |
| gguid | string | The unique identifier of the record to be inserted into the cart |
| gguidvariant | string | The unique identifier of the possible sub-variant of the record to be inserted into the cart |
| qta | single | The quantity to be inserted in the cart |
isallowed
| Description | Checks whether the current user belongs to a category |
| Value Type | boolean |
| Format | boolean = program.isallowed(permission) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| permission | double | The permission in bitwise format to be checked |
isallowedcategory
| Description | Checks whether a permission value is present within a bitwise category |
| Value Type | boolean |
| Format | boolean = program.isallowedcategory(permission, categories) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| permission | double | The permission to check |
| categories | double | The bitwise value to check against |
listlocalusers
| Description | Returns the complete list of both cloud and local users who can access the current database |
| Value Type | list<string> |
| Format | list<string> = program.listlocalusers() |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
listnamedatabases
| Description | Returns the list of available database names |
| Value Type | list<string> |
| Format | list<string> = program.listnamedatabases() |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
listpathdatabases
| Description | Returns the list of paths of currently available database files in the system |
| Value Type | list<string> |
| Format | list<string> = program.listpathdatabases() |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
loadspreadsheet
| Description | Loads a file in Excel or CSV format and converts it into a datatable object |
| Value Type | datatable |
| Format | program.loadspreadsheet(pathfile) |
| Type | Method |
| Systems | Windows |
| Parameter | Value Type | Description |
| pathfile | string | The path of the file |
newdataform
| Description | Creates a new dataform object |
| Value Type | dataform |
| Format | dataform = program.newdataform() |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
newdatauser
| Description | Creates a new datauser object |
| Value Type | datauser |
| Format | datauser = program.newdatauser(username) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| username | string | The email or username to use for creating the datauser object |
newdataview
| Description | Creates a new dataview object |
| Value Type | dataview |
| Format | dataview = program.newdataview(tablename, gguid) |
| Type | Method |
| Systems | Windows |
| Notes | If no gguid is passed, a dataview for a new record is created |
| Parameter | Value Type | Description |
| tablename | string | The name of the table |
| gguid | string | The gguid of the record to load |
newemail
| Description | Creates a new email object |
| Value Type | email |
| Format | email = program.newemail() |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
newemailv2
| Description | Creates a new emailv2 object |
| Value Type | emailv2 |
| Format | emailv2 = program.newemailv2() |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
newfileinfo
| Description | Creates a new fileinfo object |
| Value Type | fileinfo |
| Format | fileinfo = program.newfileinfo(pathfile) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| pathfile | string | The file path to use in order to create the fileinfo object |
newformtable
| Description | Creates a new formtable object |
| Value Type | formtable |
| Format | formtable = program.newformtable() |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
newnotification
| Description | Creates a new notification object |
| Value Type | notification |
| Format | notification = program.newnotification() |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
newsubscript
| Description | Creates a subscript object |
| Value Type | subscript |
| Format | subscript = program.newsubscript(gguidscript) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| gguidscript | string | The gguid of the script to load |
Examples
program.setparam("VALUE1","1")
script_example = program.newsubscript("GGUID SCRIPT")
script_example.execute()
newxmldocument
| Description | Creates a new xmldocument object |
| Value Type | xmldocument |
| Format | xmldocument = program.newxmldocument() |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
opensection
| Description | The method opens a specific section of the program by using its gguid to identify it |
| Value Type | |
| Format | program.opensection(gguidsection) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| gguidsection | string | The gguid of the section to open |
openurl
| Description | Opens the system browser to load an internet page |
| Value Type | |
| Format | program.openurl(url) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| url | string | The URL address to open |
refreshpresentation
| Description | Forces the update of a web window based on its identifier |
| Value Type | |
| Format | program.refreshpresentation(identifier) |
| Type | Method |
| Systems | |
| Parameter | Value Type | Description |
| identifier | string | The identifier of the window to be updated |
refreshsection
| Description | Forces the update of all sections in the program that use a specific table |
| Value Type | |
| Format | program.refreshsection(tablename) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| tablename | string | The name of the table used in the section to be updated |
searchdatauser
| Description | Creates a datauser object using the user’s name, full name, or initials |
| Value Type | datauser |
| Format | datauser = program.searchdatauser(value) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| value | string | The value to search for |
setparam
| Description | Saves a value in a global space of the program |
| Value Type | object |
| Format | program.setparam(key, value) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| key | string | The key of the value |
| value | object | The value to save in the parameter |
showconfirm
| Description | Displays a confirmation message |
| Value Type | |
| Format | program.showconfirm(message) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| message | string | The message to display |
showdataview
| Description | Opens a form based on a table and a record |
| Value Type | |
| Format | program.showdataview(tablename, gguid) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| tablename | string | The table containing the record to be loaded |
| gguid | string | The unique identifier of the record to be loaded |
showerror
| Description | Shows an error message |
| Value Type | |
| Format | program.showerror(message) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| message | string | The message to display |
showhtml
| Description | Displays a window containing an HTML page |
| Value Type | |
| Format | program.showhtml(html, style, identifier) |
| Type | Method |
| Systems | |
| Notes | The HTML follows the Nios4 encoding rules for handling the various actions |
| Parameter | Value Type | Description |
| html | string | The HTML to be displayed within the window |
| style | integer | Identifies the window size |
| identifier | string | The identification key of the window |
showinputbox
| Description | Displays a form for entering a text value |
| Value Type | string |
| Format | string = program.showinputbox(title, defaultvalue, ispassword) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| title | string | The title to be displayed in the form |
| defaultvalue | string | The default value to display |
| ispassword | boolean | If the value must be hidden as a password or not |
showlogin
| Description | Opens the login window |
| Value Type | |
| Format | program.showlogin() |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
showmessagebox
| Description | Displays a form containing a message or a question |
| Value Type | integer |
| Format | integer = program.showmessagebox(title, stylebutton, styleicon) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| title | string | The title to be displayed inside the message |
| stylebutton | integer | The type of buttons to display: 1 ok, 2 ok cancel, 3 yes no, 4 yes no cancel |
| styleicon | integer | The type of icon to display: 1 info, 2 question, 3 critical, 4 error |
showwarning
| Description | Shows an alert message |
| Value Type | |
| Format | program.showwarning(message) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| message | string | The message to display |
type
| Description | Indicates the type of device used |
| Value Type | integer |
| Format | integer = program.type() |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
useradmin
| Description | Retrieves the value to check if the current user is an administrator or not |
| Value Type | boolean |
| Format | boolean = program.useradmin() |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
useranonymous
| Description | Retrieves the value to check if the user is anonymous or not |
| Value Type | boolean |
| Format | boolean = program.useranonymous() |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
userdisplayname
| Description | Retrieves the full name of the current user, if filled in |
| Value Type | string |
| Format | string = program.userdisplayname() |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
usereasy
| Description | Retrieves the value to check if the current user is registered as an easy or standard user |
| Value Type | boolean |
| Format | boolean = program.usereasy() |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
userinitials
| Description | Retrieves the initials of the current user, if filled in |
| Value Type | string |
| Format | string = program.userinitials() |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
usertoken
| Description | Retrieves the authentication token from the Nios4 server if available |
| Value Type | string |
| Format | string = program.usertoken() |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |