Since the launch of Rollbase 2.5 in January we have been
working on several enhancements and new features that further improve the
flexibility of the platform to handle more complex tasks, such as:
- More Powerful Server-Side Coding Capabilities
- New Role: Query API
- Seed Records
- Bulk Importing
- Manually Run Selected Triggers on All Records
- Multi-Currency Support
- JDBC Driver (beta)
In this update you will find a summary of these new
capabilities now available to all users.
More Powerful
Server-Side Coding Capabilities
In Rollbase 2.5 the launch of the Rollbase SQL Query API was
a first step toward offering more powerful custom server-side business logic capabilities
via the combined use of server-side JavaScript and SQL. This month we further enhanced
Rollbase custom server-side coding capabilities through the addition of several
new Query API methods that have proven to be a welcome addition for
trigger-happy developers.
Trigger conditions and formulas now allow developers to use a
new set of Query API methods that allow programmatic read, write, and delete operations
on any records in your Rollbase account, not just records related to the
current object record in scope of the transaction. Developers can now write
triggers that create, update and delete arbitrary records in their Rollbase
applications allowing much greater flexibility in the creation of custom
business logic. A new trigger type called “Object Script” has been added
specifically for executing custom Rollbase code using the new Query API
methods.
The following new Query
API methods are now available in Triggers:
rbv_api.getFieldValue (objName, objId,
fieldName)
Returns
the value of a specified field from an existing record of the specified object
type
rbv_api.setFieldValue (objName, objId,
fieldname, newValue)
Updates the value of a specified field on an existing record of the specified object type
rbv_api.createRecord(objDefName,
arr)
Creates a new record of the specified object type
rbv_api.updateRecord(objDefName, objId,
arr)
Updates an existing record of the specified object type
rbv_api.deleteRecord(objDefName,
objId)
Deletes a record of the specified object type and moves it to the Recycle Bin
rbv_api.print (text)
Used to
print debug messages which are only shown while using the Trigger debugger (not
shown at runtime)
New Role: Query API
To supplement the major new Query API enhancements, Rollbase
now includes a new Role called Query API that is used to define access control
permissions for all Query API requests. In cases when a trigger is executed by a
user who does not have permission to perform the requested query API operation,
if the Query API role has the permission required the operation will be
executed. This allows developers to write custom code that performs necessary
operations outside the scope of the current user (i.e. without regard for the current
user’s permissions).
Seed Records
Application Publishers can now include default data with
their applications by selecting records to be published as part of the
application definition. These records, referred to as Seed Records, can be
added from the application’s details page.
Bulk Importing
Importing large amounts of records can be very slow when
each imported record invokes one or more triggers and other complex business
logic. In order to enable efficient data loading through the Rollbase user
interface, a new “Bulk” import mode is now available in the Import tool. Using
this option disables all triggers during the import process and is optimized
for performance. Customers have already been successful in uploading over
250,000 records from a single CSV file.
A “Test” mode is also available and recommended for
debugging purposes before importing any significant amount of data in either
Normal or Bulk mode. Test mode will only import five records and will record
all trigger debugging information along with the standard import output.
In addition to the new importing modes, Rollbase now has a
single global import queue in order to provide improved response times for all
hosted customers. No more than one import job will run at a time, ensuring that
no single tenant can consume an unreasonably large amount of processing time
due to simultaneous imports.
Manually Run Selected
Triggers on All Records
Developers can now manually invoke one or more triggers on
all object records for a given object type. This is particularly useful when a
complex mass update needs to be performed on all records such as after a bulk
import (see above).
Multi-Currency
Support
Rollbase now supports any number of currencies, exchange
rates, base currencies and automated currency calculations. There are several
new components that work together to enable full multi-currency support:
1.
Each Currency field can now have an associated “Base
Currency” field (a read-only field that is automatically calculated and updated
using exchange rate data). In this way you can track and manage data in any
currency and easily roll it up into one or more currencies based on your
business needs.

2.
As an Administrator you can define any number of
currency codes to use throughout your Rollbase system:


3.
Exchange rate data can be programmatically updated
via the Rollbase SOAP API, or manually managed in the Setup area by selecting a
base currency and a date:


For convenience purposes the previous day’s rates will be shown when entering values for a new date:


JDBC Driver (beta)
The beta version of a new Rollbase JDBC driver is now available
for download from within the Setup > Applications Setup area. This allows
you to treat your Rollbase account as a remote database and programmatically
access it just as you would any other database.
The beta version is limited to SELECT queries only. We plan
to expand the driver to support more SQL commands based on customer demand.
Your feedback is welcome and encouraged.
For example, the below is an excerpt from a simple Java example included with the JDBC driver
that shows how to programmatically connect to Rollbase and retrieve information
about records of an object called “invoice”:
Class cls =
Class.forName("com.rollbase.jdbc.RollbaseDriver");
Properties props = new Properties();
props.setProperty("user", args[0]);
props.setProperty("password", args[1]);
Connection conn =
DriverManager.getConnection("jdbc:rollbase://www.rollbase.com",
props);
Statement st =
conn.createStatement();
ResultSet rs = st.executeQuery("SELECT COUNT(1) FROM invoice");
rs.next();
int count = rs.getInt(1);
System.out.println("Invoice count: "+count);
rs = st.executeQuery("
"SELECT id, name, amount FROM invoice WHERE amount>0");
while (rs.next()) {
long id = rs.getLong(1);
String name = rs.getString(2);
double amount = rs.getDouble(3);
System.out.println("id="+id+"
name="+name+" amount="+amount);
}