Disable requirements by user or role

The examples below show how to disable requirement validation for all of your form fields, based on a list of user emails or Fulcrum roles.

Email:

ON('load-record', function(event) {
  var emails = ['[email protected]', '[email protected]'];
  if (CONTAINS(emails, EMAIL())) {
    DATANAMES().forEach(function(dataName) {
      SETREQUIRED(dataName, false);
    });
  }
});

Role:

ON('load-record', function(event) {
  if (ISROLE('Owner', 'Manager')) {
    DATANAMES().forEach(function(dataName) {
      SETREQUIRED(dataName, false);
    });
  }
});