My Account

MAX Script Reference - Developer Site

Object Function Description
window
open(maxid) opens the MAX application identified by maxid
reload(online) reloads the current page
alert(text) displays a non blocking text message in the page title
history
back() navigates to the previous page in the history
[queryid]
execute() executes the query identified by its id attribute[queryid].
[itemid]
edit() edits the list item identified by its id attribute [itemid]

window.open(maxid, version)

Opens the MAX application identified by the string parameter maxid, which is the id attribute of the <max> element and requires that the MAX application version is version. The version attribute of the currently stored application is checked against the version parameter. If the local application is older than the version parameter, a request to the MAX Application store Web Service is performed to download the latest version. At this time, all local data store created by the MAX application are cleared, to ensure the data structure is the latest one.

The first page of the target max application is displayed.

Note : this function is used internally by the system.home application to start the user's max applications. It is recommended to use the href="max://appid/pageid" attribute of a <item> element to link to other applications.

window.reload(online)

Reloads the current page.

  • If online parameter is 1, all  queries of type=select in the page are asked to refresh their content from the webservice URL of their datasource, even if the cache is uptodate.
  • If online = 0, no server refresh occurs, even if one or more queries are not up to date.

alert(text)

Displays a non blocking text message by replacing the current title of the current page by the text paramter during 2 seconds.

history.back()

Navigates to the previous page in the history. This function does the same as pressing the Back menu button. It allows programatic access this function.

Note : during a back operation, no HTTP connection is made, even if the queries found in the previous page expired in the cache. It allows quick return to the preivous page.

[queryid].execute()

Executes the query identified by its id attribute [queryid]. This query must be found in the current page. Must be a update, insert or delete query. If the query is of type=insert, the MAX variable {query.lastrowid} will contain the primary key of the just inserted record.

[itemid].edit()

Edits the list item identified by its id attribute [itemid], found in the current page. It is the script equivalent of clicking on an item of type=select, but this be can applied to any item, even a non visible one.

Note: this function is useful when implementing a New item feature, where you ask first the item name which popups a dialog box by clicking on a regular <item> element