I have a simple problem but may be serious for me , I made custom fields and added them all in the custom\modules\Leads\metadata\detailviewdefs.php
(detailview layout) of Leads module but problem is that i have to make a installer package of changes. I managed with custom fields and copied them in the custom\Extension\modules\Leads\Ext\Vardefs
through manifest. Now i don't know how to apply detailviewdefs changes through manifest (add new fields panel in detailview). The point is that the existing detailview layout should not be changed but only add a new panel in it.
Possible solution in my mind is like I should add code in $layout_defs array $layout_defs["Leads"]["DetailView"] ['panels']['panel_name']
and place it in custom\Extension\modules\Leads\Ext\Layoutdefs\
and copy Layoutdefs file through manifest. I tried this but not seems working one.
Looking for a smart solution share if you can.
Addition:
Even if i export module changes from Studio ->export Customizations
and import in other instance with module builder
. It override all the previous custom files(customizations) in newer instance (Is it not a limitation in SugarCRM) but my requirement is to add only changes in newer instance's detailview.
I had found following functions of sugar's
ModuleInstaller
class to add or remove fields from layouts throughmanifest script
. These functions will add/remove fields to botheditview
anddetail view
at the same time. Just add following lines inpost_install / pre_install
no need to require anything,To add
users_access
field inUsers
module:To remove
users_access
field fromUsers
module:Hope it's helping.
mansoor
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).