Asif Nadeem

Issue when extending RecordView(detailview) from multiple Modules

Discussion created by Asif Nadeem on Sep 1, 2016
Latest reply on Oct 5, 2016 by Anand Ingle

Playing around with Sugar 7.X Module Loader having two Modules I found the next issue. If the Modules are trying to use the same Record View, or example both Modules are adding features on Accounts Detail View Page, one is overriding the extended settings from the other.

 

Here is the scenario:

 

Two Distinct Modules having special Javascript code in this file:
/custom/modules/Accounts/clients/base/views/record/record.js

 

Modul A has defined a RecordView Click Event like this:

 

({
    extendsFrom: 'RecordView',
    initialize: function (options) {
        this._super('initialize', [options]);
        this.context.on('button:thisIsMyButtonForA:click', this.openPopup1, this);
    },
    openPopup1: function(){       
    }  
})

 

Modul B has a RecordView Click Event too:

 

({
    extendsFrom: 'RecordView',
    initialize: function (options) {
        this._super('initialize', [options]);
        this.context.on('button:thisIsMyButtonForB:click', this.openPopup2, this);
    },
    openPopup2: function(){       
    }  
})

 

After installing this two Modules, B is overriding A RecordView file (record.js).

 

Is there another way to merge Record Views from different Modules or the only way is to do this manually?

Outcomes