How to Modify the filters in "ProductSelectionSchema" for product list | OOTB Orders?

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.

 

Like 0

Like

3 comments

Hello Bhoobalan,

 

Regarding the first question, the add button is defined in the ProductDetailV2 schema from the ProductCatalogue package. In this part:

onProductSelectionButtonClick: function() {
					var isCardChanged = this.isCardChanged();
					if (isCardChanged) {
						var args = {
							isSilent: true,
							messageTags: [this.sandbox.id]
						};
						this.set("OpenProductSelectionModule", true);
						this.sandbox.publish("SaveRecord", args, [this.sandbox.id]);
					} else {
						this.loadProductSelectionModule();
					}
				},

 

Regarding the second part where you need custom filters, pleast contact us at support@creatio.com specifying each request and each question in detail in order to understand the business task and what is the current issue.

 

Best regards,

Dariy

 

Dariy Pavlyk,

Thanks for sharing this!

 

Is it possible to make the Product object in the Opportunity section (OpportunityProductInterest) to open the product catalogue?

What are the steps to be carried out to make this OpportunityProductInterest open the product catalogue list?



 

BR,

Bhoobalan Palanivelu.

 

Bhoobalan Palanivelu,

 

We're glad to see that you were able to achieve this functionality as mentioned in these articles

https://community.creatio.com/questions/enable-product-catalog-list-ord…

https://community.creatio.com/questions/enable-product-catalog-list-ord…

 

Unfortunately, as it's mentioned there, it wouldn't be possible to set up a product catalogue using our OOTB object, as it is already implemented for other functionalities. 

 

Best regards,

Dariy

Show all comments