Price Tag Search Plugin
Occasionally, users may wish to hide Price Tags and Discount Tags from Sales Reps when working on a Quote Line Item or Order Product in the Line Editor, without the need to deactivate these tags.
For example, users with different profiles might need to use varied sets of price tags for different products. To offer this level of flexibility, we offer an interface plugin for admin users to modify the outcomes of the price tag search within the Line Editor.
The user can follow the steps below to implement an Price Tag Search Plugin to create a price tag search filter using Salesforce Apex code.
Step 1: Implement Price Tag Search Plugin
Step 2: Register the Plugin
Step 3: Test the price tag search
Step 1: Implement the Price Tag Search Plugin
Create an Apex class that implements the following interface:
Ruby.CustomPluginManager.PriceTagSearchPlugin
Note : The apex class must be declared as ‘global’ since the interface is a global interface
Please see an example below:
// Example: if the user profile is ‘Account Executive’, hide all tags with ‘Deal Desk Only’ in the name.
global class CustomPriceTagSearchPlugin implements CustomPluginManager.PriceTagSearchPlugin {
global CustomPriceTagSearchPlugin() {}
global String getAdditionalSearchFilters() {
System.debug('tina: calling getAdditionalSearchFilters');
String userProfile = [SELECT Profile.Name FROM User WHERE Id = :UserInfo.getUserId()].Profile.Name;
if (userProfile == 'Account Executive') {
return 'AND (NOT Name LIKE \'Deal Desk Only%\')';
}
return '';
}
}
Step 2: 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 'PriceTagSearchPlugin’ and click ‘Edit’. If there is no entry found, create a new record with the following information:
- Name: PriceTagSearchPlugin
- Category: Custom Plugin
- Description: Price Tag Search Plugin
- Label: Price Tag Search Plugin
- In the Value field, enter your Apex class name, e.g., CustomPriceTagSearchPlugin, and click 'Save'.
Step 3: Test the Plugin
The plugin is now ready for testing. To proceed, log in using the designated testing user account, access a quote, go to the line editor, and select the 'Price Tag' icon within a quote line. Confirm that only the price tags available with the additional search filters are visible.