Okay, so this is a pretty advanced level question (I think) and only people who have really worked in depth with SugarCRM might be able to answer this.
What I am trying to achieve is this.
I want to load and render all (or selected) fields of any module (Dynamic), for e.g. "Tasks" Module, into the record view of another custom module e.g. "Custom_Templates" Module. I want to be able to edit the values in those fields as well. What I am looking to do is append those fields below the current fields that I have in my "Custom_Templates" Module.
So, here is what I have done so far.
- I have created a new custom Layout. (modules/Custom_Templates/clients/base/layouts/related-module-fields-layout)
- I have created a new custom View. (modules/Custom_Templates/clients/base/views/related-module-fields-view)
- I have added the new custom layout and view into the record layout of my "Custom_Templates" Module.
$module_name = 'Custom_Templates';
$viewdefs[$module_name]['base']['layout']['record'] = array(
'components' => array(
array(
'layout' => array(
'type' => 'default',
'name' => 'sidebar',
'components' => array(
array(
'layout' => array(
'type' => 'base',
'name' => 'main-pane',
'css_class' => 'main-pane span8',
'components' => array(
array(
'view' => 'record',
'primary' => true,
),
array(
'layout' => 'related-module-fields-layout',
),
array(
'layout' => 'extra-info',
),
In my related-module-fields-view.hbs file, I have added
<h1 id='new-id'>I AM HERE!</h1>
And I can see this heading appended in the record view at the bottom. But this is as far as I have gone. I am stuck here. I can't figure out how I can populate fields of any module from it's metadata and render those fields in this view. Any help in this regard would be appreciated.