Disabling RLI Alerts on Opportunities
Overview
How to disable Revenue Line Item (RLI) alerts on Opportunities using a custom JavaScript controller.
Overriding the Record View
First, we must override the stock opportunities record view. This will handle the RLI alerts when navigating to an existing record. This can be done by creating:
./custom/modules/Opportunities/clients/base/views/record/record.js
({
extendsFrom: 'OpportunitiesRecordView',
initialize: function (options) {
this._super('initialize', [options]);
},
/**
* Hide the warning message about missing RLIs
* @param string module The module that we are currently on.
*/
showRLIWarningMessage: function(module) {
//here we create an empty override function
},
/**
* @inheritdoc
*/
_dispose: function() {
this._super('_dispose', []);
}
})
As you can see, this file extends from 'OpportunitiesRecordView' which points our code to extend the stock ./modules/Opportunities/clients/base/views/record/record.js
file.