Skip to content

Smart Quote: Customer Facts

Customer Facts allow your Smart Quote Rules to make logical decisions based on the specific customer associated with a quote or order. This enables powerful automation, such as customer-specific pricing, regional tax adjustments, or restricting certain products to specific clients.

Accessing Customer Data in Rules

In the when block of a rule, you can use the CustomerFact function to retrieve data about the current customer.

Example: Targeted Messaging

This rule checks if the customer is "Acme Corp" and displays a specific reminder to the Sales Rep.

when
    var config = Configurator();
    var cust = CustomerFact(x => x.Name == "Acme Corp");

then
    config.LogInformation("Reminder: Acme Corp requires specialized packaging for all orders.");

Example: Regional Logic

You can also use customer properties like State or Country to drive configuration logic (e.g., ensuring electrical components match the customer's regional standards).

when
    var config = Configurator();
    var cust = CustomerFact(x => x.Country == "UK");

then
    config.AddItem("PLUG_TYPE_G", 1.0m); // Automatically add UK-style power cord

Dynamic Filtering Based on Customer Data

Customer Facts can also drive the valid values for Attributes. Use a Smart Quote rule to apply the appropriate item-attribute filter for the customer; new SQL valid-value queries are disabled.

Example: Customer-Specific Item Lists

Use the rule-based item filter to populate a dropdown from the catalog after determining the customer's permitted material grade.

config.Attribute("MATCOND")
    .Valid()
    .FromItems()
    .Category("Raw Materials")
    .Attribute("COND")
    .HasName("GRD").HasValue("17-4")
    .Values();

Replace 17-4 with the grade selected by the customer-specific rule. See Dynamic Catalog Lookups for the Attribute Query page's JSON lookup builder, which searches the tenant Item Catalog.

Best Practices

  1. Data Integrity: Ensure your Customer Master Data is clean and consistent, as any errors in customer records will directly impact how rules fire.
  2. Use for Compliance: Use Customer Facts to block the sale of specific items to customers in regions with specific regulatory restrictions.
  3. Tiered Benefits: Combine Customer Facts with Price Factor Rules to automatically apply negotiated discounts for strategic accounts.