NSOA.listview.data(listviewId)

Use this function to read the published list view data available to the user running the script. The function returns a specialized list view data iterator (length, index, next, each).

Tip:

Use published list views like custom queries and read only the necessary list view data in your OpenAir scripts.

Important:

Both form and scheduled scripts support the NSOA.listview.data(listviewId) function. However, the number of items you can process in form scripts is restricted by the scripting governance time limits. The function is best suited for reading published list view data in scheduled scripts, which allow up to 1 hour of JS runtime and 1 hour of web services API call time. For more information about scripting limits, see Scripting Governance.

Note:

The Business Intelligence Connector feature must be enabled for your account to use NSOA.listview and NSOA.report functions. The Business Intelligence Connector feature is a licensed add-on. To enable this feature, contact your OpenAir account manager.

For more information about publishing list views and reports to the OpenAir OData service, see Business Intelligence Connector.

Parameters

Returns

Units Limit

Since

Example

          // get the iterator for listview data, it has following members
// it consumes 10 units for each 1000-item page loaded into iterator on-demand
//  * 'length' - number of items
//  * 'index'  - index of last returned item
//  * 'next'   - returns next item from iterator or undefined when iterator is done
//  * 'each'   - calls specified function for each item in the iterator
var iterator = NSOA.listview.data(7);

// get number of listview records
var row_count = iterator.length;

// grab first two records
var first  = iterator.next();
var second = iterator.next();

// process rest of the listview
iterator.each(function(record, index) {

    // search for particular name
    if (record.Name === "Nathan Brown") {

        // set the field value
        NSOA.form.setValue("remaining_budget__c", record["Remaining Budget"]);

        // stop iterating
        return false;
    }
});