Hi Team,
I would like to modify the filters for the list of Product Displayed while adding products in OrderProduct (In Order record).
Step 1: How does the add button event open ProductSelectionSchema?
Step 2: Need to update the filters in ProductSelectionSchema?
The Product selection schema has "loadGridData" method that calls "getProductInBasePriceListEsq" where the BasePriceList is taken and filtered.
Also, in OOTB the Account and its price list are sent to ProductSelectionSchema and how do the values are transferred?
Below are the filters required,
1.Dont need to display any base price list for any products.
2.Filter the Product Price List only if it has start date.
3.Filter the Product Price List only if end date is empty or null.
4.Need an additional parameter to filter the Product (price list table, column is grade).
i.e., Grade column value is passed from Order page and it has to be compared in ProductSelectionSchema.
Note: Date filters or other filters are not applying and it always shows the base price list. And how to get the values from OrderPageV2 to ProductSelectionSchema (if it is through message mechanism, how the OOTB Account and its pricelist is transferred and what are the schemas and where it is defined both subscription and publish of basepricelist)
define("ProductSelectionSchema", [],
function() {
return {
methods: {
init: function(callback, scope) {
this._initViewActionItems();
this.set("CurrentDataView", "GridDataView");
this.set("DataViewToChange", "GridDataView");
this.moneyModule = MoneyModule;
this.initAttributeDefaultValues();
this.callParent([function() {
this.Terrasoft.chain(
this.initEntitySchema,
this.initProfile,
this.requestMasterEntityData,
this.loadCurrencyRates,
this.initCurrencies,
function() {
this.loadGridData();
this.subscribeSandboxEvents();
this.Ext.callback(callback, scope);
},
this
);
}, this]);
},
getProductInBasePriceListEsq: function(basePriceList) {
var basePriceListProductEsq = this.getBaseESQ("Product");
var productPricePrefix = "[ProductPrice:Product:Id].";
basePriceListProductEsq.rowCount = 40;
basePriceListProductEsq.addColumn("Price", "ProductPrice");
basePriceListProductEsq.addColumn(productPricePrefix + "Price", "Price");
basePriceListProductEsq.addColumn(productPricePrefix + "Currency", "Currency");
basePriceListProductEsq.addColumn(productPricePrefix + "Tax", "Tax");
basePriceListProductEsq.addColumn(productPricePrefix + "Tax.Percent", "DiscountTax");
basePriceListProductEsq.addColumn(productPricePrefix + "PriceList", "PriceList");
basePriceListProductEsq.addColumn(productPricePrefix + "DBLStartDate", "StartDate");
basePriceListProductEsq.addColumn(productPricePrefix + "DBLEndDate", "EndDate");
basePriceListProductEsq.addColumn(productPricePrefix + "DBLProductGrade", "DBLProductGrade");
basePriceListProductEsq.filters.addItem(this.Terrasoft.createFilter(this.Terrasoft.ComparisonType.EQUAL,
productPricePrefix + "Product.Id", "Id"));
basePriceListProductEsq.filters.addItem(this.Terrasoft.createColumnFilterWithParameter(
this.Terrasoft.ComparisonType.EQUAL, productPricePrefix + "PriceList.Id", basePriceList.value));
/*basePriceListProductEsq.filters.addItem(this.Terrasoft.createColumnFilterWithParameter(
this.Terrasoft.ComparisonType.LESS_OR_EQUAL, productPricePrefix + "DBLStartDate", today));
basePriceListProductEsq.filters.addItem(this.Terrasoft.createColumnFilterWithParameter(
this.Terrasoft.ComparisonType.EQUAL, productPricePrefix + "DBLEndDate", null));
Need Filters
1.Dont need to display any base price list for any products.
2.Filter the Product Price List only if it has start date.
3.Filter the Product Price List only if end date is empty or null.
4.Need an additional parameter to filter the Product (price list table, column is grade).
i.e., Grade column value is passed from Order page and it has to be compared in ProductSelectionSchema.
*/
basePriceListProductEsq.filters.addItem(this.Terrasoft.createColumnFilterWithParameter(
this.Terrasoft.ComparisonType.EQUAL, productPricePrefix + "DBLProductGrade", productGrade.value));
this.applyAdditionalFilters(basePriceListProductEsq);
this.initializePageableOptions(basePriceListProductEsq);
basePriceListProductEsq.filters.addItem(
this.Terrasoft.createColumnFilterWithParameter(this.Terrasoft.ComparisonType.EQUAL,
"IsArchive", false));
return basePriceListProductEsq;
},
},
diff: []
};
});
Any support on this case is appreciated!
BR,
Bhoobalan Palanivelu.