Administration - Smart Quote: Error and Warning Strategy
Effective use of logging functions ensures that Sales Reps are guided through complex configurations without being overwhelmed by technical "noise" or blocked unnecessarily.
This guide covers the best practices for using LogError, LogWarning, LogRequired, and LogMessage within the Smart Quote Rules engine.
Guidance Strategy Overview
The following table summarizes the different logging levels and their impact on the user experience.
| Function | Toast (Popup) | Sidebar Message | Prevents Finish | Usage |
|---|---|---|---|---|
LogRequired() |
Blue (Required) | Yes | Yes | Required first-screen selections (gates Add to Quote) |
LogError() |
Red (Error) | No | Yes | Invalid configurations that cannot be built |
LogWarning() |
Orange (Warning) | No | No | Potential issues or sub-optimal choices |
LogMessage() |
No | Yes | No | General workflow guidance |
LogInformation() |
No | No | No | Tips/Suggestions |
When to use LogError (The "Hard Gate")
Use LogError only for conditions that make a product impossible to manufacture or legally non-compliant.
- Physical Constraints: e.g., "The selected motor is too large for this chassis."
- Regulatory Compliance: e.g., "This material is not certified for use in BSL-3 environments."
- Logical Dead-ends: e.g., "Selecting 'Option A' and 'Option B' creates a conflict that the system cannot resolve."
Result: The user is blocked from "Finishing" the quote or adding it to a Sales Order until the conflict is resolved.
When to use LogWarning (The "Soft Nudge")
Use LogWarning for conditions that are valid but sub-optimal or require additional attention.
- Lead Time Impact: e.g., "Choosing 'Custom Paint' will add 3 weeks to the standard lead time."
- Commercial Guidance: e.g., "This configuration is eligible for a volume discount if the quantity exceeds 50 units."
- Technical Advice: e.g., "While valid, we recommend a secondary finish for outdoor applications."
Result: The user sees an orange warning but is not blocked. They can proceed with the quote if they acknowledge the situation.
Using LogRequired for Progressive Disclosure
LogRequired should be used to enforce a "workflow gate." It is most effective when applied to the very first page of a configuration.
- Best Practice: Instead of showing a list of 50 empty attributes, use
LogRequiredon core attributes (like "Product Type" or "Base Material"). - Impact: It forces the user to make high-level decisions first, which may then trigger the appearance of specific Pages or Attributes via Page Display Control.
Implementation Examples
Basic Validation
when
var config = Configurator();
var length = Attribute_DEC(x => x.NameIs("Length") && x.ValueIsGreaterThan(500m));
then
config.LogError("Length cannot exceed 500mm for this model.");
Negative Logic Requirements
when
var config = Configurator();
not Attribute_TXT(x => x.NameIs("Power_Type"));
then
config.LogRequired("Please select a Power Type to continue.");
Related Topics
- Rule Functions Reference - Full list of available actions.
- Rule Facts (Attributes) - How to access data in your rules.
- Validate Configuration - How to test your rules and logic.