AnsweredAssumed Answered

Issue when extending RecordView or RecordlistView from multiple Modules

Question asked by Emil Maran on Nov 6, 2014
Latest reply on Jan 29, 2015 by Emil Maran
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