Dmitrii Mikhalchenko

Record view does not display any data after views/custom-record-accounts/custom-record-accounts.js  created

Discussion created by Dmitrii Mikhalchenko on Jul 3, 2016

I have a custom package to display organization chart. While installation it creates a new button for Accounts and opportunities RecordView. From manifest file:

10 => array(

'from' => '<basepath>/SugarModules/Accounts/views/custom-record-accounts/custom-record-accounts.js',

'to' => 'custom/modules/Accounts/clients/base/views/custom-record-accounts/custom-record-accounts.js',

),

11 => array(

'from' => '<basepath>/SugarModules/Opportunities/views/custom-record-opportunities/custom-record-opportunities.js',

'to' => 'custom/modules/Opportunities/clients/base/views/custom-record-opportunities/custom-record-opportunities.js',

),

12 => array (

'from' => '<basepath>/SugarModules/Accounts/layouts/record/record.php',

'to' => 'custom/modules/Accounts/clients/base/layouts/record/record.php',

),

13 => array (

'from' => '<basepath>/SugarModules/Opportunities/layouts/record/record.php',

'to' => 'custom/modules/Opportunities/clients/base/layouts/record/record.php',

),

 

In accounts layout record.php view is defined as

'components' => array(

array(

'view' => 'record',

'primary' => true,

),

array(

'view' => 'custom-record-accounts',

),

array(

'layout' => 'extra-info',

),

......

)

 

custom-record-accounts.js:

({

extendsFrom: 'AccountsRecordView',

initialize: function (options) {

this._super('initialize', [options]);

this.context.on('button:view_org_chart:click', this.view_org_chart, this);

console.log('custom-record-account controller');

},

view_org_chart: function() {

var ajax_url = "index.php?module="+this.module+"&action=ShowOrgChart&record="+this.model.id;

var url = '#' + app.bwc.buildRoute(this.module, null, 'ShowOrgChart', {

'record': this.model.id

});

window.location = url;

}

})

 

The problem is that after upgrade from 7.6.2.2 to 7.7.0 Accounts and Opportunities recordView does not display any record details, only subpanels.

if I move

custom/modules/Accounts/client/base/views/custom-record-accounts/custom-record-accounts.js

to

custom/modules/Accounts/client/base/views/record/record.js

everything works fine.

 

But it is not safe to build an installable package with record.js included in case CRM already has a custom record controller in it.

 

Any ideas why it is broken for 7.7?

 

Regards,

Dmitrii

Outcomes