SugarCRM installable changes in detailview

强颜欢笑 提交于 2019-12-04 10:15:32

That's a tough one. There are two options that I know of. 1) Provide directions to the user for how to add the fields to the layouts using Studio 2) In a post_install.php script mimic how a Studio layout deploy works to insert your fields into any given layout (best practice would be to create a new panel for all of your fields if mass distributing).

I had found following functions of sugar's ModuleInstaller class to add or remove fields from layouts through manifest script. These functions will add/remove fields to both editview and detail view at the same time. Just add following lines in post_install / pre_install no need to require anything,

   $installer_func = new ModuleInstaller();
   $layoutAdditions = array('Users' => 'users_access');

To add users_access field in Users module:

   $installer_func->addFieldsToLayout($layoutAdditions);

To remove users_access field from Users module:

   $installer_func->removeFieldsFromLayout($layoutAdditions);

Hope it's helping.

mansoor

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!