Rules Engine

MonetizeNow's rules engine lets you describe your business policies once, as IF this, THEN that rules, and have MonetizeNow apply them to every quote.

For example:

  • IF any line is discounted more than 50% THEN the Deal Desk must approve the quote.
  • IF payment terms aren't Net 30 THEN Legal must approve.
  • IF the billing contact has no full address THEN stop the rep from submitting.
  • IF Analytics Seats are on the quote without Gold Support THEN suggest the upsell.
  • IF Platinum Support is sold THEN add the service-level wording to the quote.
I want to…Go to
Understand the building blocksHow the rules engine works
Decide between != and NOT!= or NOT? Which one to use
Build my first ruleTutorial: your first rule
Combine conditions, compare fields, count or sum linesHow-to guides
Look up an operatorReference
Get ideasRules worth building

How the rules engine works

Explanation

One engine, several kinds of rule

Every kind of rule uses the same condition builder. What differs is the THEN: what happens when the rule matches.

Rule typeWhereWhen it matches…Details
Approval RulesSettings → Rules → Approval Rulesthe quote needs approval from a person or team before it can be sentApproval Rules
Validation RulesSettings → Rules → Validation Rulesthe rep sees an Error (blocks submission), Warning or Info messageValidation Rules
Conditional TermsSettings → Rules → Conditional Termsterms are added to the quoteConditional Terms
Record AutomationSettings → Rules → Record Automationfields are set on new bill groups, or the customer portal changesRecord Automation
Quote Share RulesSettings → Quote ShareQuote Share settings change for that quoteQuote Share

This page covers the IF part, which works the same everywhere. Approval rules, validation rules and conditional terms are checked against quotes; the screenshots here use approval rules.

Settings → Rules → Approval Rules listing example rules with their order and status

Conditions and criteria

The IF part of a rule is made of conditions, numbered 1, 2, 3…

Each condition:

  1. looks at one kind of record, its target object: the Quote, its Quote Offerings, its Quote Items, its Quote Conditional Terms or its Quote Documents;
  2. contains one or more criteria (a field, an operator and a value), such as Discount Percent > 50.

The key idea: all the criteria in one condition are checked against the same record. Separate conditions are checked independently.

  • "Analytics Seats has a discount over 50%" → one Quote Item condition with two criteria (Product = Analytics Seats, Discount Percent > 50). It only matches if a single line is both.
  • "Analytics Seats is on the quote, and any line has a discount over 50%" → two conditions. They can be matched by different lines.

A condition on Quote Offerings or Quote Items is true if any offering or item matches. Use an aggregate condition to look at them together.

flowchart TD
    Q[Quote] --> O1[Quote Offering: Time Lord Enterprise]
    Q --> O2[Quote Offering: TARDIS Data Warehouse]
    O1 --> I1[Quote Item: Analytics Seats]
    O1 --> I2[Quote Item: Gold Support]
    O2 --> I3[Quote Item: TARDIS Data Warehouse]

Quote Offering and Quote Item conditions can also use fields from their parents, for example Quote Offering → Offering Name or Quote → Net Terms on a Quote Item condition.

How conditions are combined

The IF dropdown decides how conditions combine:

OptionThe rule matches when…
All Conditions Are Metevery condition is true
Any Condition Is Metat least one condition is true
Custom Logic Is Metyour own formula is true, for example (1 OR 2) AND NOT 3

Each condition has the same dropdown, including Custom Logic Is Met, for combining its own criteria. Each condition also has a NOT box that reverses its result (true becomes false).

!= or NOT? Which one to use

These two look alike but answer different questions when a condition looks at Quote Items or Quote Offerings, because a quote has many of them.

You writeIt asksOn a quote with Analytics Seats, Gold Support and TARDIS Data Warehouse
Quote Item: Product != Gold SupportIs there any line that isn't Gold Support?True: the Seats line isn't Gold Support
Quote Item: Product = Gold Support, with NOT tickedIs there no line that is Gold Support?False: there is a Gold Support line

So:

  • To check that a product is missing from the quote, use = with NOT (or Product = Gold Support with NOT in custom logic). Don't use !=.
  • Use != (or Not In) when you want to describe one line, usually together with other criteria in the same condition. For example, Product != Gold Support and Discount Percent > 20 means "a line other than Gold Support has more than 20% off".

On the Quote itself there's only one record, so the two are the same: Net Terms != Net 30 and NOT [Net Terms = Net 30] give the same result.

GoalUse
"The quote doesn't include product X"Quote Item condition: Product = X, tick NOT
"A line other than X has property Y"Quote Item condition: Product != X and Y, in the same condition
"A quote-level field isn't a value"Quote condition: !=, or = with NOT. Either works

Tutorial: your first rule

Tutorial. About 5 minutes. You'll build an approval rule that sends any quote with a line discounted more than 50% to the Deal Desk team, then test it on a real quote.

You need: Tenant Admin or Sales Admin, and at least one quote.

1. Start a new rule

Go to Settings → Rules → Approval Rules and click New. Enter a Name, Deep discounts need Deal Desk approval, and a Description.

A new Approval Rule form

2. Choose how conditions combine

Leave IF as All Conditions Are Met.

The IF options: All Conditions Are Met, Any Condition Is Met, Custom Logic Is Met

3. Choose what to look at

In condition 1, change the target object from Quote to Quote Item: you want to check each line.

Target object options: Quote, Quote Conditional Terms, Quote Offering, Quote Item, Quote Documents

4. Add the criterion

Set Compare From Field to Discount Percent, Operator to > and Compare To to 50.

The condition: Quote Item, Discount Percent > 50

5. Say what happens

Under THEN, open Approver 1, switch to the Team tab and choose Deal Desk.

Deal Desk chosen as the approver

6. Test it

Expand Test Rule, choose a quote (here, Bad Wolf Media – Enterprise expansion, which has Analytics Seats at 55% off) and click Test Rule. Green results mean the rule matches this quote; each condition shows its own result.

Test results: the rule and condition 1 evaluated to true

7. Save

Click Save. From now on, every quote with a line discounted over 50% needs the Deal Desk's approval.

What you learned: a rule is a target object, criteria, a way to combine them, and an outcome, and you can test it on a real quote before it affects anyone.


How-to guides

Combine conditions with custom logic

How-to

  1. Add each condition you need with + Add Condition (under the conditions). They're numbered 1, 2, 3…
  2. Set IF to Custom Logic Is Met.
  3. Type the formula using the numbers, AND, OR, NOT and brackets, for example (1 OR 2) AND NOT 3.
Three conditions combined with (1 OR 2) AND NOT 3: over $100k, or Net 60/90, unless a Deal Desk member owns the quote

Every condition must appear in the formula, and every number must match a condition:

  • 1 AND (2 OR 4) isn't valid if there's no condition 4, or if condition 3 is missing.
  • 1 OR 2 isn't valid if the rule has only one condition.

Use the copy icon on a condition to duplicate it, and the bin icon to remove it.

Check two things on the same line

How-to

Add both criteria inside one condition with + Add Condition within that condition's box. Both are checked against the same Quote Item.

One Quote Item condition with two criteria: Product = Analytics Seats and Discount Percent > 50

Compare one field with another

How-to

In Compare To, change Value to Field and choose the other field. You can pick any field of the same type from the same target object, including its parent's fields (for example Quote → Contract Start Date on a Quote Offering condition). For example, Expiration Date > Field: Contract Start Date catches quotes that would still be open after the contract should have started.

Expiration Date compared with the Contract Start Date field

This is most useful with custom fields synced from your CRM, for example comparing the quote's expiration date with an opportunity close date mapped through Salesforce or HubSpot field mapping.

To allow some slack between two dates, use the Differs From Date Field operator instead. You set how far apart they may be (More Than / Less Than a number of days, weeks, months or years) and in which direction (Before, After or Either Direction). For example, Quote Offering → Start Date differs from Contract Start Date by more than 5 days after.

Count, sum or compare lines (aggregate conditions)

How-to. Quote Offering and Quote Item conditions only.

An aggregate condition looks at all the offerings or items that match the condition's criteria, together.

  1. In a Quote Item (or Quote Offering) condition, set the criteria that pick the lines, for example Product In Analytics Seats, Platinum Support.
  2. Click + Aggregate Condition.
  3. Choose the Operator and, where needed, the Field and Value, for example Has Different Value on Quantity.
An aggregate condition: Analytics Seats and Platinum Support lines with different quantities
Aggregate operatorYou chooseTrue when…
Has Same Value / Has Different Valuea Fieldthe matching lines all share, or don't all share, that field's value
Count Equals / Greater Than / Less Than / Greater Than or Equal To / Less Than or Equal Toa Valuethe number of matching lines compares to your value
Sum Equals / Greater Than / Less Than / Greater Than or Equal To / Less Than or Equal Toa numeric Field and a Valuethe total of that field across the matching lines compares to your value

For Quote Items, tick Evaluate each offering ramped segment individually to check each scheduled-change segment on its own. For example, quantities must match within each segment but can differ between segments.

On amendment and renewal quotes, deleted offerings and items are ignored unless you tick Include Deleted Records on the condition.

Check every day of a quote

How-to. Approval rules, validation rules and conditional terms only.

The FOR dropdown sets how dates on the quote are treated:

OptionMeaning
All days of the Quote (default)The quote is checked as a whole.
Every day of the QuoteThe quote is split into date ranges and each one is checked separately. The rule matches if any range matches.

Use Every day of the Quote for rules like "Silver and Gold can't be on a contract at the same time". An amendment that upgrades from Silver to Gold, with no overlapping dates, then passes.

The FOR options

Test a rule

How-to

  1. Expand Test Rule at the bottom of the rule.
  2. Choose a quote in Choose a quote to test rule against.
  3. Click Test Rule. You'll see whether the rule is valid, whether it evaluated to true, and the result of each condition.

True means the rule applies. For an approval rule, true means the quote needs this approval. Testing never changes the quote, and works before you save.


Rules worth building

Ideas

RuleTypeIFTHEN
Deep discountsApprovalQuote Item → Discount Percent > 50Deal Desk team approves
Non-standard payment termsApprovalQuote → Net Terms Not In Net 30Legal approves
Manager approval for their repsApprovalQuote → Owner's Team = your team and Amount > 50,000The team's manager approves
No backdatingValidation (Error)Quote → Contract Start Date: Before Current Month = True"Start date can't be in a past month."
Clean billing dataValidation (Error)Quote → Contacts → Billing Address → Line 1: Exists = False"Add a complete billing address."
PO number formatValidation (Warning)Quote → PO Number: Character Length < 10"PO numbers are 10 characters."
Upsell nudgeValidation (Info)1: Quote Item → Product = Analytics Seats; 2: Quote Item → Product = Gold Support, with NOT ticked (see != or NOT? above)"Consider upselling to Gold Support."
Matching quantitiesValidation (Warning)Quote Item → Product In Seats, Platinum Support; aggregate: Quantity Has Different Value"Seats and Platinum Support should match."
Too many one-off chargesApprovalQuote Item → Product → Type = One-Time; aggregate: Count Greater Than 3Deal Desk approves
SLA wordingConditional TermQuote Item → Product = Platinum SupportAdd the service-level terms
Long contractsApprovalQuote → Contract Length > 36Finance approves
A validation rule using NOT: condition 1 finds Analytics Seats, condition 2 (NOT) checks there's no Gold Support line

Reference

Target objects for quote rules

Target objectHolds
QuoteQuote-level fields: amount, currency, net terms, dates, contacts, owner and Owner's Team, PO and VAT numbers, quote custom fields, account fields
Quote OfferingEach offering (bundle): offering, rate, billing frequency, dates, amounts, discounts, plus its quote's fields
Quote ItemEach product line: product, quantity, prices, discounts, revenue, plus its offering's and quote's fields
Quote Conditional TermsThe conditional terms on the quote: name, the rule that added it, and whether it was edited
Quote DocumentsDocuments attached to the quote: document type, status, position and original source

Operators

The operators you can choose depend on the field's type.

OperatorField typesTrue when…Example
= / !=Text, number, currency, date, true/false, list, referencethe value matches / doesn't matchNet Terms = Net 30
> / >= / < / <=Number, currency, dategreater / at least / less / at mostAmount > 1,000,000
In / Not InList, referencethe value is / isn't one of those you pickNet Terms In Net 30, Net 60
ExistsAll types except true/false fields and lists of textthe field has a value (True) or is empty (False)PO Number Exists = True
Contains / Does Not ContainTextthe text includes / doesn't include a phraseDescription Contains "renewal"
Starts With / Ends WithTextthe text starts / ends with a phraseCustom ID Starts With "EU-"
Character Length > / < / =Textthe number of characters compares to a numberPO Number Character Length = 10
Includes / Not IncludesLists of text, such as Account → Account-level CCsthe list contains / doesn't contain a valueAccount-level CCs Includes "[email protected]"
First Day Of Month / Last Day Of MonthDatethe date is (True) or isn't (False) the first / last day of a monthStart Date First Day Of Month = False
Before Current Month / After Current MonthDatethe date is before / after the current monthStart Date Before Current Month = True
More Than N Days / Weeks / Months / Years In PastDatethe date is more than N units before todayCreated more than 30 days in past
More Than N Days / Weeks / Months / Years In FutureDatethe date is more than N units after todayStart Date more than 90 days in future
Differs From Date FieldDatethe date is more / less than an amount from another date field, before, after or either wayOffering Start Date differs from Contract Start Date by more than 5 days
The first operators offered for a date field; the list scrolls to show the rest

Compare To

OptionCompares with
ValueA value you type or pick
FieldAnother field on the same record, of a matching type

Custom logic syntax

ElementMeaning
1, 2, 3…Condition numbers
AND, OR, NOTCombine, or reverse a condition (NOT 3 works like ticking NOT on condition 3)
( )Group

Every condition must be used, and every number must refer to a condition that exists.


What’s Next

Review how to configure rules to streamline your sales processes.

Did this page help you?