Séverin Nandillon
05/17/2024, 9:00 AMdefine('OverrideQuoteFilters.EntryPoint', [
'Quote.List.View',
'Quote.Model',
'Utils',
], function (QuoteListView, QuoteModel, Utils) {
'use strict';
console.log('Step 1');
// Overriding the filter to stick with the quote status instead of entityStatus
// OK
QuoteListView.prototype.filterOptions = [
{
value: 'ALL',
name: Utils.translate('Show all statuses'),
selected: true,
},
{
value: 'A',
name: Utils.translate('Open'),
},
{
value: 'B',
name: Utils.translate('Processed'),
},
{
value: 'C',
name: Utils.translate('Closed'),
},
{
value: 'V',
name: Utils.translate('Expired'),
},
{
value: 'X',
name: Utils.translate('Voided'),
},
{
value: 'Y',
name: Utils.translate('Undefined'),
},
];
// Overriding the method to fetch the quotes based on the status instead of entityStatus
QuoteModel.prototype.setExtraListFilters = function () {
console.log('Step 2');
if (this.data.filter && this.data.filter !== 'ALL') {
// this.filters.entitystatus_operator = 'and';
// this.filters.entitystatus = ['entitystatus', 'is', this.data.filter];
this.filters.status_operator = 'and';
this.filters.status = ['status', 'is', this.data.filter];
}
};
QuoteModel.prototype._getQuoteStatus = function (estimate_id) {
console.log('Step 3');
const estimates = nlapiSearchRecord(
'estimate',
null,
[['internalid', 'is', estimate_id], 'and', ['mainline', 'is', 'T']],
// [new nlobjSearchColumn('entitystatus')]
[new nlobjSearchColumn('status')]
);
return estimates[0];
};
});
Chris
05/17/2024, 2:57 PM'use strict;'
try putting your function overrides into this:
return {
mountToApp: function (application) {
... your code here ....
}
Like here: https://developers.suitecommerce.com/develop-your-first-extension.html#add-an-entry-point-javascript-file