[Vtigercrm-developers] Changing default view for all users

Alan Lord alanslists at gmail.com
Wed May 3 08:28:48 GMT 2017


On 03/05/17 08:49, MrJingles wrote:
>
> It seems so unusual that what I want to do isn't just available as standard.
> If anyone has any ideas, then that would really be appreciated.

You can change the default All views using the vtlib API...

Get an instance of the view and delete it ($module is a vtlib instance 
of the target module):

> $filter = Vtiger_Filter::getInstance('All', $module);
> if ($filter != false) {
> 	$filter->delete();
> }

Then re-create it with the fields and order you wish

> $filter = new Vtiger_Filter();
> $filter->name = 'All';
> $filter->isdefault = true;
> $module->addFilter($filter);
> // Add fields to the filter created
> $filter->addField($field_firstname)->addField($field_lastname, 1)->addField($field_phone, 2)->addField($field_email, 3)->addField($field_postcode, 4)->addField($field_jssector, 5)->addField($field_jsplacestatus, 6);

Or, of course, there is a very cheap extension module on the Extension 
store which allows you to do the same thing:

https://marketplace.vtiger.com/app/listings?id=101


Al




More information about the vtigercrm-developers mailing list