Tutorial
✨ Nue AI
Price Builder Chatbot
19 min
the price builder chatbot is an ai assistant embedded directly in the quote line editor it allows admins, revops, and pricing teams to design and manage line editor ui plugins using natural language instead of writing javascript by hand and deploying the code to nue on salesforce manually you can use the price builder chatbot to complete the following, all via natural language create new pricing and discount rules as ui plugins apply validations and inline messages to guide sales reps deploy , undeploy , and delete plugins from the side panel embedded in the quote line editor test and debug the plugin logic in the quote line editor view and inspect the plugin logic before you go live permission required the following nue permission is required to access the price builder chatbot ai ➡️ price builder chatbot only users whose role/profile has the price builder chatbot permission can see the chatbot panel in the line editor interact with it to create, list, deploy/undeploy, or delete ui plugins when the user has this permission enabled, the price builder chatbot side panel will be available in the quote line editor, as shown in the following image the chatbot side panel opens from within the quote line editor, letting you test changes on real quotes in context figure 1 quote line editor where the price builder chatbot side panel can be opened key concepts line editor ui plugins a docid\ x6e13mb90quos 12c1pig is a piece of javascript that runs in the quote line editor context and can update line item fields such as quantity, discount, netsalesprice, totalprice, or custom fields (custom field c) apply info / warning / error messages at the header or line level plugins are triggered on specific events , for example ui afteredit – run after a user edits a field ui beforecalculation – run before pricing calculation ui aftercalculation – run after calculation is complete plugins can be triggered by field change event occurred at both line level and header level note that the price builder chatbot is embedded in the quote line editor so you can build extensions using quote data, but once created, those extensions will also run on the line editor of orders plugin lifecycle from the chatbot’s point of view, a plugin typically flows through draft (created, not active) chatbot generates code and creates the plugin record (not yet deployed) in the price builder chatbot, all newly created plugins are in the draft status active (deployed) isactive = true – plugin logic runs in the line editor in the price builder chatbot, you can prompt "activate this plugin" or "deploy this plugin" to change the status of a plugin to active inactive (undeployed) isactive = false – plugin remains available but does not run in the price builder chatbot, use the prompt "deactivate this plugin" or"undeploy this plugin" to set a plugin's status to inactive deleted only inactive plugins may be deleted in the price builder chatbot, use the prompt "delete this plugin" or "cleanup inactive plugins" to delete inactive plugins the chatbot uses the nue price builder mcp tools to move plugins through these states line editor extension lifecycle what you can build the following table shows real world examples of what you can build with the price builder chatbot each use case maps to a ui plugin that enforces pricing rules, auto fills defaults, applies discounts, and standardizes billing behavior for every scenario, it outlines the business goal, when the plugin runs (trigger event), what the rep sees in the line editor, and an example prompt you can use to generate the plugin use case example prompt to chatbot business goal when it runs (trigger) billing timing guardrails for recurring products create a new plugin for the following use case after someone edits billing timing, if the product is recurring, don’t allow in arrears show an error and remove it when they pick a valid option stop reps from picking billing timing that doesn’t work for recurring products after a user edits billing timing auto fill usage quantity to 3000 create a new plugin for the following use case before calculation, if a usage line has quantity blank or zero, set it to 3000 don’t change other lines apply to children and ramp items too after someone updates quantity on a usage product, show a warning if it’s not 3000, and clear it when it returns to 3000 make sure usage items always start with a standard baseline quantity before pricing is calculated non discountable products create a plugin that prevents quote level discounts from being applied to certain non discountable products the plugin should trigger when a user changes quote level discount fields (discount, discountamount, or totalprice) identify non discountable products by two criteria products with sku equal to "nue platform" products with a price model of "onetime" (services products) ensure that certain products or certain types of products (e g , services) are not discountable after a user edits one of the following header level fields discount discount amount total price apply bulk discounts over a certain type of products create a new plugin for the following use case before calculation, if there are at least two integration product lines, set them to 30% discount only when the current discount is lower, and show an info message on each affected line automatically apply a volume discount when more than one "integration" products are quoted before pricing is calculated apply discounts to services products if more than one ai products are selected this is a more complex use case of percentage of total create a new plugin for the following use case after any edit, if there are 2+ nue ai products, apply a 15% discount to them, and set implementation services price to 10% of the combined nue ai amount including children apply a bundle discount and automatically price implementation based on ai spend after any edit validate the quote start date create a new plugin to show an error message if the quote start date is earlier than today automatically validate the quote start date if it is earlier than today after header date edits example use cases use case apply non discountable product rules in the line editor business problem challenge organizations often have specific products or services that should never receive discounts due to business rules, contractual obligations, or margin requirements for example platform/core products foundational products like "nue platform" may have fixed pricing that cannot be discounted due to licensing agreements or strategic pricing decisions professional services one time services (implementation, consulting, training) typically have fixed labor costs and cannot absorb discounts without impacting profitability the problem when sales reps apply quote level discounts (discount %, discount amount, or adjusted total price), the system automatically distributes that discount across all line items—including products that should be protected from discounting this leads to unintended margin erosion on protected products pricing policy violations inaccurate quotes that don't reflect actual pricing rules manual corrections required after the fact user pain point sales reps have no visibility into which products are non discountable, and the system doesn't prevent or warn them when they inadvertently discount protected products solution this plugin provides real time protection and user feedback when quote level discounts are applied automatic price protection when a quote level discount is applied, the plugin sets keepdiscretionaryprice true on non discountable line items, preserving their original pricing informative user feedback displays clear, contextual info messages on affected line items so sales reps understand why certain products aren't being discounted smart message management automatically clears the informational messages when the discount is removed (set to 0), keeping the ui clean comprehensive coverage checks both parent line items and nested children to ensure all protected products are covered example prompt create a plugin that protects certain products from quote level discounts when a user changes the quote level discount (discount %, discountamount, or totalprice), the plugin should identify non discountable products by two criteria products with sku equal to "nue platform" products with a price model of "onetime" (services products) when a quote level discount is applied set keepdiscretionaryprice true on those line items to preserve their pricing show an info level message on the discount field with title "non discountable product" for nue platform products "the quote level discount cannot be applied to nue platform lines " for onetime products "services products cannot be discounted " when the discount is removed (set to 0) clear/remove the messages from those line items check both parent line items and their children (nested line items) only trigger when header level discount fields are changed (discount, discountamount, or totalprice) use case apply exclusion and exclusion rules in the line editor this use case demonstrates how to use the price builder chatbot to create a line editor ui plugin that enforces product inclusion & exclusion and prevents invalid quote configurations directly in the line editor business problem the tax manager product requires exactly one downstream tax integration in our example, avalara integration, sphere integration, or stripe tax integration to function correctly allowing a quote to proceed without a valid integration, or with multiple competing integrations, creates configuration errors that can lead to order activation and provisioning issues solution use the price builder chatbot to build a validation plugin that automatically enforces tax manager → integration dependencies and surfaces clear, actionable error messages directly in the line editor business logic if a quote contains a product named tax manager, it must include exactly one of the following integration products avalara integration, sphere integration, stripe tax integration the quote cannot contain more than one of these integration products at the same time the validation must search recursivly across top level line items child line items the plugin runs before calculation so issues are captured early before the pricing engine calculates the prices example prompt create a plugin that validates tax manager product dependencies the rules are if a quote contains a product named "tax manager", it must also have at least one integration product the valid integration products are avalara integration stripe tax integration sphere integration only one integration product is allowed per quote if there are multiple integrations, show an error error messages should be displayed at the header level if tax manager exists without any integration on each tax manager line item (on the productname field) if no integration exists on each integration line item (on the productname field) if there are multiple integrations clear the errors when the conditions are satisfied (integration is added, or duplicates are removed) search recursively through all line items including children line items using the price builder chatbot in the line editor opening the chatbot login to salesforce > nue on salesforce open any quote that you'd like to build and test the price builder chatbot with expand the price builder chatbot side panel from the right hand side the price builder chatbot side panel viewing existing ui extensions when you ask to see existing plugins (e g , “show me all ui extensions for this quote”), the chatbot calls a tool that lists all line editor ui plugins with details such as name description owner trigger event active / inactive status from this list, you can view – open and inspect the plugin’s javascript code (read only in most cases) deploy / undeploy – toggle whether the plugin is active in the line editor just type your prompt you can also type prompts like “view all active plugins” or “view plugins created today ” creating a new ui extension (plugin) in the chatbot panel, choose “create a new ui extension” describe your scenario in natural language (e g , any of the example prompts) the chatbot will ask follow up questions to clarify your requirements generate javascript code following nue’s plugin structure and best practices (logging, error handling, etc ) all console logs will be generated with prefix "\[nue pricing plugin]" so that you can filter the logs in the console fill in plugin metadata such as name, plugintype, triggerevent, isactive, and code you review the generated code in the ui you ask the chatbot to verify and test the generated code with mock data this helps the chatbot to make sure the generated javascript code compiles and runs successfully with the mock data once you confirm the chatbot creates the plugin (but does not have to deploy it immediately) you can choose whether to deploy it now and test directly in the line editor add inline messages (info, warning, error) plugins can surface user friendly messages inline in the line editor, for example info – explain applied discounts or defaulted values warning – highlight risky choices (e g , high discounts, unusual quantities) error – block invalid inputs (e g , disallowed billing timing) messages can be attached to the header (overall quote level) a specific line multiple lines at once when you include messaging requirements in your prompt (e g , “show a warning when…”), the chatbot will generate code that calls the appropriate helper (such as $$addmessage() or $$removemessage() for you about messages if you ask the chatbot to show a message when a user violates a rule (for example, applying a discount above a certain threshold), make sure to also instruct it to remove the message once the user fixes the issue info/warning/error info/warning/error messages are saved with the quote in the message object when the quote is saved, and they will carry over to the order when the quote is finalized however, an order cannot be activated if there is any error level message present deploying and undeploying a plugin to make a plugin live (or to disable it), you can type "activate/deactivate the plugin" or "deploy/undeploy the plugin" the chatbot performs the actual deployment/undeployment via the corresponding mcp tools once deployed, the plugin becomes active, and then you can test the plugin with the current quote by refreshing the browser page deleting plugins you can ask the chatbot to delete unused plugins only inactive plugins can be deleted if you ask to delete a plugin that is still active, the chatbot will detect this and suggest deactivating it first; it will not deactivate it automatically for safety best practices & troubleshooting start from a concrete use case use the patterns in the examples section above as templates when you talk to the chatbot be explicit about triggers and conditions often times you need to mention exactly when you want the rule to run (beforecalculation, afteredit, etc ) let the chatbot ask questions the flow is designed so the bot confirms edge cases before creating code use custom fields explicitly when referencing custom fields, be ready to provide their api names (e g , custom discount reason c ) test in the line editor after deploying a plugin, validate behavior using realistic quotes and verify messages, discounts, and quantities behave as expected monitor via logging use browser dev tools to search for \[nue pricing plugin] in the console to trace the plugin’s logic log the full context ask the chatbot to print $$headerobject so you can inspect everything it knows about the quote during the current trigger event search line items recursively when looking for a specific line especially inside bundles tell the chatbot to search through child lines recursively handle change order line types correctly in change orders, make sure the chatbot distinguishes summaryitem (summary line), rampitem (ramp lines), and lineitem (standard product line) so it updates the right records
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.