Question

Override getQuickSearchFilterConfig function in product selection page

Hi,

I want the filter on the product selection page  (on the order section) to filter by contains name and not srats_with like it is now.

I found the getQuickSearchFilterConfig function on the Product selection page schema.

Can you assist how to override it?

(replace the Column: "Name",

                                    ComparisonType: Terrasoft.ComparisonType.START_WITH with

Column: "Name",

                                    ComparisonType: Terrasoft.ComparisonType.CONTAIN

 

My question is where I should put the script so it's override the OOB function?

I tried creating a replacing view model and put the function there, but when I tried opening the product in order selection page it loads forever...

Thanks,

Chani

Like 0

Like

2 comments
Best reply

Hi Chani,

 

To override the function you need to create a replacing view module and specify ProductSelectionSchema module as a parent, define the module properly (use the code below as a template):

define("ProductSelectionSchema", [], function() {
	return {
		methods: {},
		diff: /**SCHEMA_DIFF*/[]/**SCHEMA_DIFF*/
	};
});

and add the getQuickSearchFilterConfig function inside the methods object of the code above.

 

Best regards,

Oscar

Hi Chani,

 

To override the function you need to create a replacing view module and specify ProductSelectionSchema module as a parent, define the module properly (use the code below as a template):

define("ProductSelectionSchema", [], function() {
	return {
		methods: {},
		diff: /**SCHEMA_DIFF*/[]/**SCHEMA_DIFF*/
	};
});

and add the getQuickSearchFilterConfig function inside the methods object of the code above.

 

Best regards,

Oscar

Oscar Dylan,

Thank you!

It worked.

Show all comments