Opportunity Product Detail Filter on Lookup

Good Day,

I have been trying to add a filter on Product Lookup on OpportunityProductDetailV2 but does not seem to work. Anyone knows what my problem is? Here's my current code.

Thank You
 

 

define("OpportunityProductDetailV2", [], function() {
	return {
		entitySchemaName: "OpportunityProductInterest",
		attributes: {},
		methods: {
			prepareProductLookup: function(config) {
              debugger;
                var filterGroup = this.Terrasoft.createFilterGroup();
                filterGroup.add("ProductNameFilter", this.Terrasoft.createColumnFilterWithParameter(
                    this.Terrasoft.ComparisonType.CONTAIN, "Name", "Test"
                ));
 
                config.filters.add("customProductFilter", filterGroup);
                this.callParent(arguments); // Call the parent method if needed
            }
		},
		diff: /**SCHEMA_DIFF*/ [
			{
                "operation": "merge",
                "name": "Product",  // Lookup field to which the filter is applied
                "values": {
                    "bindTo": "Product",
                    "controlConfig": {
                        "prepareList": {
                            "bindTo": "prepareProductLookup" // Binding the method to prepare lookup with filters
                        }
                    }
                }
            }
		]/**SCHEMA_DIFF*/
	};
});
Like 0

Like

1 comments

Hi everyone, 

you can ignore this, turns out I was adding the custom code to the wrong page. It should be on OpportunityProductPageV2 instead of the one above.

Thanks

Show all comments