JavaScript API Reference/Ab.view.Resriction object

new Ab.view.Restriction(fieldValues, relOp)

Parameters:

  • fieldValues (JS object): (optional) field values that will be used to create restriction clauses;
  • relOp (String): (optional) Relational operation code; possible values are ' AND ' (default), ' OR ', ')AND( ', or ' )OR( '.


Example:

Refresh the project report and apply the restriction based on all console field values:

var form = View.getControl('', 'console');
var restriction = new Ab.view.Restriction(
form.getFieldValues()
);
var grid = View.getControl('', 'projects');
grid.refresh(restriction);


Using the Ab.view.Restriction object in this manner is no different from using ad-hoc restriction object:

var form = View.getControl('', 'console');
var restriction = form.getFieldValues();
var grid = View.getControl('', 'projects');
grid.refresh(restriction);