UpviseJS Application Structure Guide

An UpviseJS Application consist of just one Javascript file containing:

This application is deployed to a given Upvise account and available to all users in this account.
User can access the application either when they login on their web account at htttps://www.upvise.com/uws or on their phone using th Upvise native App for iOs, Android, Windows Phone or Blackberry.

Application fundamentals

Each UpviseJS app contains at minimum:
Config.appid= "myapp";
Config.version = "1";
Config.title= "My App";

function main() {
    // some code goes here
}

Versioning & Deployment

String interpolation

UpviseJS uses a lot of function callback expressed as javascript string function calls in its API, for example List.addItem("Go to Page2", "page1()"); It is often needed to pass dynamic parameter values in this callback function, for example to display the details of a record from a list view. the function callback string needs to be a valid javascript function call, so the parameters of this function has to be properly formatted or escaped. If a primary string id is passed, it need to be quoted using simple quote.

In order to produce a valid javscript callback function you must escape the parameters using the Upvise JS global function esc(obj). Based on the runtime type of obj (string or number), it escapes it and add simple quotes around it if required. so you should write:
var id = 'yhinitmvkr4566';
List.addItem("John Smith", "viewContact(" + esc(id) + ")");

UpviseJS framework makes it even better and support natively string interpolation using the {} brackets inside any string literals. At runtime, during application installation it is converted to the corresponding esc() calls. The same rule applies to the where clause of Query.select() or Query.update()

var id = 'yhinitmvkr4566';
List.addItem("John Smith", "viewContact({id})");

var monthStart = Date.month();
var contacts = Query.select("contacts.contacts", "id;name", "date<{monthStart}");