Jam.py documentation

rec_count

rec_count

domain: client

language: javascript

class Item class

Description

Read the rec_count property to get the number of records ownered by the item’s dataset.

If the module declares an on_filter_record event handler and the Filtered attribute is set, this property calculates the number of records that satisfy this filter, otherwise the record_count method is used to calculate the number of records.

See also

record_count

Example

function edit_invoice(invoice_id) {
    var invoices = task.invoices.copy();
    invoices.open({ where: {id: invoice_id} }, function() {
        if (invoices.rec_count) {
            invoices.edit_record();
        }
        else {
            invoices.alert_error('Invoices: record not found.');
        }
    });
}