Returns
object[] -

An array of menu items. Each item should have the following things:

Samples
 
//returns a list of menu items that point to Companies view
var menuEntries = [];

//this entry shows only active companies
menuEntries.push({
  label: 'Active Companies',
  icon: 'account-circle',
  view: 'companies',
  filters: {
    active: 'true'
  }
});

// this entry shows only inactive companies
menuEntries.push({
  label: 'Inactive Companies',
  icon: 'flower',
  view: 'companies',
  filters: {
    active: 'false'
  }
});

// this entry shows all the companies (no filter applyed)
menuEntries.push({
  label: 'All the Companies',
  icon: 'case',
  view: 'companies'
});

return menuEntries;
 
//return a list of menu items. Each menu entry points to contacts grid view and the contacts are filtered by company
var companies = sys.data.find('companies', {});
var entries = [];
while (companies.hasNext()) {
  var company = companies.next();
  entries.push({
    label: company.label(),
    view: 'contacts',
    icon: 'case-check',
    filters: {
      company: company.label()
    }
  });
}

return entries;
 
//return one menu item for Contacts view that shows only contacts with a value on ipAddress field
return [{
    label: 'Contacts with IP Address',
    view: 'contacts',
    filters: {
      ipAddress: 'notEmpty()'
    }
}];
 
//return one menu item for Contacts view that shows only contacts for company test A and company ABC
var menuEntries = [];

menuEntries.push({
  label: "Contacts for test A and ABC",
  icon: "account-circle",
  view: "contacts",
  filters: {
      company: ["test A", "ABC"]
   }
});

return menuEntries;
 
//return one menu item for for Companies view that shows the related company for current logged user
var menuEntries = [];

menuEntries.push({
  label: 'User company',
  icon: 'account-circle',
  view: 'companies',
  filters: {name: 'currentUserField(company.name)'}
});

return menuEntries;