How-to Guide
Nue Platform
Product Search Plugin
4 min
use cases when creating a quote or an order, sometimes the selectable products can be different under different conditions for example, the available products may be restricted or limited for different channel sales to support this case, you can add a product search plugin to implement the business logic via salesforce apex code implement product search plugin interface create an apex class and implement the product search interface ruby custompluginmanager productsearchplugin the plugin returns a string containing soql query conditions, which will be appended to the query when searching for products in the line editor note the apex class must be declared as ‘ global ’ since the interface is a global interface please see an example below / an example product selector plugin that returns different sets of products by sales channel / global class productsearchadditionalfilterplugin implements ruby custompluginmanager productsearchplugin { global string getadditionalsearchfilters(){ // get current object id id currentobjectid = ruby custompluginmanager getobjectid(); // check whether the object is quote if(schema quote sobjecttype == currentobjectid getsobjecttype()){ quote quote = \[select id, name, opportunity recordtype name from quote where id = currentobjectid]; string additionalfilter = ''; if(quote opportunity recordtype name == 'channel'){ additionalfilter = '(product type c = '+ '\\'channel\\'' + ' or product type c = null)'; } return additionalfilter; } else{ return ''; } } } register the plugin login to your salesforce org and navigate to setup search for ‘custom setting’ and navigate to the custom settings list page click on the ‘manage’ link on ‘nue system setting’ search for ‘productsearchplugin’ and click ‘edit’ in the edit page, add your apex class name to the value field and save the change now in the line editor for both quotes and orders, the plugin will be executed when users search for products
🤔
Have a question?
Get answers fast with Nue’s intelligent AI, expert support team, and a growing community of users - all here to help you succeed.
To ask a question or participate in discussions, you'll need to authenticate first.