The Complete Guide to Placeholders in Business Rules
Introduction
Imagine showing a user an error message that says: "Value exceeds limit." While technically informative, it leaves users asking critical questions: Which value? What limit? By how much? What should I do?
Now imagine showing: "Credit limit exceeded. Customer ACME Corp has credit limit $50,000 but current balance $45,000 plus this order $10,000 would total $55,000, exceeding the limit by $5,000. Please reduce order amount, collect payment, or request credit limit increase."
The difference? Placeholders—dynamic field references that transform generic messages into specific, actionable, helpful communications that empower users to resolve issues immediately.
Placeholders are one of the most powerful yet underutilized features of QUALIA Rule Engine. This comprehensive guide explains what placeholders are, how they work, where you can use them, advanced techniques for complex scenarios, troubleshooting common issues, and best practices for creating messages that users actually appreciate.
What Are Placeholders?
Definition
A placeholder is a dynamic reference to a field value that gets replaced with the actual data when the rule executes.
Syntax: [TableNumber:FieldNumber]
Example:
[18:2] → Customer Name from table 18, field 2
[36:109] → Amount Including VAT from table 36, field 109
[27:3] → Item Description from table 27, field 3
How Placeholders Work
When QUALIA Rule Engine processes a rule action with placeholders:
Rule condition evaluates to TRUEAction is triggered (Error, Warning, Email, etc.)
Engine identifies placeholders in action text (anything in [TableNo:FieldNo] format)
For each placeholder:
Lookup table number
Access specific field
Retrieve current field value
Replace placeholder with actual value
Final message displayed to user with all placeholders resolved
Example execution:
Message template:
"Order amount $[36:109] would exceed credit limit $[18:59]"
At runtime:
- [36:109] is replaced with actual order amount: 55000
- [18:59]
Why Placeholders Are Critical
Without placeholders (static messages):
With placeholders (dynamic messages):
Error: "Credit limit exceeded. Customer [18:2] has credit limit $[18:59]
but current balance $[18:61] plus this order $[36:109] would total
$([18:61] + [36:109]), exceeding the limit by $([18:61] + [36:109] - [18:59]).
Please reduce order amount to $([18:59] - [18:61]
Benefits:
✅ Users understand the specific issue
✅ Users see relevant data values
✅ Users know how to resolve the problem
✅ Reduces support tickets
✅ Faster problem resolution
✅ Better user experience
Placeholder Syntax and Components
Basic Syntax
Format: [TableNumber:FieldNumber]
Components:
Opening bracket: [
Table number: Business Central table number (integer)
Colon separator: :
Field number: Business Central field number (integer)
Closing bracket: ]
Examples:
[18:1] → Customer No. (Table 18, Field 1)
[18:2] → Customer Name (Table 18, Field 2)
[18:59] → Credit Limit (Table 18, Field 59)
[36:3] → Document No. (Table 36, Field 3)
[36:109] → Amount Including VAT (Table 36, Field 109)
[27:8]
Common Business Central Tables Referenced:Table 18 - Customer: No. (1), Name (2), Credit Limit (59), Balance (61), Payment Terms (27), Blocked (39)
Table 36 - Sales Header: No. (3), Document Type (1), Amount Including VAT (109), Status (120), Order Date (99)
Table 27 - Item: No. (1), Description (3), Unit Price (18), Unit Cost (21/22), Base Unit of Measure (8)
Finding Table and Field Numbers
Method 1: Business Central Table Browser
Search for "Tables" in Business Central
Find your table (e.g., "Sales Header")
Note table number (e.g., 36)
Open table
Show fields
Find your field (e.g., "Amount Including VAT")
Note field number (e.g., 109)
Method 2: QUALIA Rule Engine Field Helper
In Rule Set, navigate to Conditions or Actions
Use Field Lookup feature (if available)
Select table
Select field
System inserts correct placeholder syntax
Method 3: Business Central Documentation
Official Microsoft documentation lists table and field numbers
Community resources and forums
BC object browser extensions
Common Business Central Tables (Reference):
Case Sensitivity and Spacing
Placeholders are NOT case-sensitive (generally):
[18:2] ✓ Works
[18:2]
Spacing is NOT allowed inside brackets:
[18:2] ✓ Correct
[ 18:2 ] ✗ May not work (spaces inside brackets)
[18: 2] ✗ May not work (space after colon)
[ 18 : 2 ]
Best practice: Use no spaces, consistent formatting: [TableNo:FieldNo]
Where Placeholders Can Be Used
1. Error Messages
Purpose: Explain why transaction is blocked with specific data
Syntax:
Action Type: Error
Message: "Your message with [TableNo:FieldNo]
Example:
Message: "Cannot create order. Customer [18:2] is blocked for [18:40]
Placeholders Used:
[18:2] - Customer (Table 18): Name (Field 2) - Customer name
[18:40] - Customer (Table 18): Blocked (Field 40) - Blocked reason (e.g., Ship, Invoice, Payment, All)
Best practices for error messages:
Explain what's wrong
Show relevant data values
Provide specific resolution steps
Include contact information if needed
2. Warning Messages
Purpose: Alert user to potential issue but allow them to proceed
Syntax:
Action Type: Warning
Message: "Your message with [TableNo:FieldNo]
Example:
Message: "Unit price $[37:22] is below standard price $[27:18].
Margin is only [([37:22] - [27:21]) / [37:22] * 100]%.
Confirm you want to proceed with this pricing."
User sees:
"Unit price $45.00 is below standard price $50.00.
**Placeholders Used:**
Best practices for warnings:
Explain the unusual condition
Provide context with data
Allow user to make informed decision
3. Confirmation Messages
Purpose: Ask user to confirm an action with specific details
Syntax:
Action Type: Confirmation
Message: "Your message with [TableNo:FieldNo]
Example:
Message: "This order for $[36:109] exceeds typical order size of $[18:73]
for customer [18:2]
4. Email Notifications
Purpose: Send detailed notifications to stakeholders
Syntax:
Action Type: Email
To: [email protected]
Subject: "Subject with [TableNo:FieldNo]"
Body: "Message body with [TableNo:FieldNo]
Example:
To: [email protected]
Subject: "Large Order Created: $[36:109]"
Body: "Sales order [36:3] was created by [USERID] for customer [18:2]
with amount $[36:109].
Order details:
- Customer: [18:2] ([18:1])
- Amount: $[36:109]
- Payment Terms: [36:64]
- Requested Delivery: [36:76]
- Salesperson: [36:43]
Best practices for email notifications:
Clear, descriptive subject line
Structured body with key information
Include relevant context
Provide actionable information
5. Message Actions (Informational)
Purpose: Provide information without blocking transaction
Syntax:
Action Type: Message
Message: "Your message with [TableNo:FieldNo]
Example:
Message: "Customer [18:2] has outstanding balance of $[18:61].
Current payment terms are [18:27]
6. Field Assignments
Purpose: Auto-populate fields with calculated or referenced values
Syntax:
Action Type: Assign
Field: [TargetTableNo:TargetFieldNo]
Value: [SourceTableNo:SourceFieldNo]
Example 1: Simple assignment:
Action: Assign
Field: Salesperson Code [36:43]
Value: [18:30]
Example 2: Calculated assignment:
Action: Assign
Field: Discount Amount [36:176]
Value: [36:109]
Note: Not all field types support placeholder-based assignment. Verify in QUALIA Rule Engine documentation.
7. URL Actions
Purpose: Provide links to external systems with dynamic parameters
Syntax:
Action Type: URL
URL: "https://system.com/page?param=[TableNo:FieldNo]
Example:
URL: "https://crm.company.com/customer?id=[18:1]&name=[18:2]
Advanced Placeholder Techniques
Calculations with Placeholders
Placeholders can be used in arithmetic expressions:
Operators:
+ Addition
- Subtraction
* Multiplication
/ Division
Example: Calculate total:
Message: "Order total including balance: $([36:109] + [18:61]
Example: Calculate difference:
Message: "You are over limit by $([36:109] + [18:61] - [18:59]
Example: Calculate percentage:
Message: "Discount percentage: [([36:176] / [36:109]
Example: Complex calculation:
Message: "Margin: [(([37:22] - [27:21]) / [37:22]
Order of operations: Standard mathematical precedence (parentheses, multiplication/division, addition/subtraction)
Formatting Placeholders
Currency formatting:
In many systems, append currency symbol:
"$[36:109]" → "$125,000.00"
Or use locale-specific formatting:
"Amount: [36:109]
Note: Formatting capabilities depend on QUALIA Rule Engine implementation. Check documentation for supported formatting options.
Percentage formatting:
"[([36:176] / [36:109]Date formatting:
"[36:99]Decimal places: System typically formats based on field definition in Business Central.
Conditional Placeholders (Text Logic)
Use case: Show different text based on field value
Approach: Use multiple rules with different conditions and messages
Example:
Rule 1:
Scenario 1: [18:39] is true
Scenario 2: [18:40] is 'Payment'
Message: "Customer [18:2] is blocked for Payment. Contact accounting at ext. 2000."
Rule 2:
Scenario 1: [18:39] is true
Scenario 2: [18:40] is 'Shipment'
Message: "Customer [18:2] is blocked for Shipment. Contact shipping at ext. 3000."
Rule 3:
Scenario 1: [18:39] is true
Scenario 2: [18:40] is 'All'
Message: "Customer [18:2]
Each rule fires for different blocking reasons with appropriate message and contact info.
Multi-Table Placeholders
Use linked tables to reference related data:
Example: Sales Order referencing Customer and Item:
Trigger Table: Sales Line (37)
Linked Tables:
- Sales Header (36)
- Customer (18)
- Item (27)
Message: "Item [27:3] for customer [18:2] at price $[37:22].
Standard price is $[27:18], cost is $[27:21].
Order total is $[36:109]
Table linking requirements:
Linked tables must be configured in Source References
Appropriate filters must exist to link tables
Fields from linked tables accessible via their table numbers
Placeholder in Subject Lines
Email subjects should be concise but informative:
Poor subject:
"Notification"
Better subject:
"Order Created"
Best subject:
"Order [36:3] Created: $[36:109]
Nested Calculations
Complex business logic can use nested expressions:
Message: "Effective price after discount:
$([37:22] - ([37:22] * [37:11]
Another example:
Message: "Available credit:
$([18:59] - ([18:61] + [36:109]
Troubleshooting Placeholders
Problem: Placeholder Not Replaced (Shows Literal [18:2])
Symptoms: Message shows [18:2] instead of "ACME Corp"
Possible causes:
1. Incorrect syntax:
[18:2] ✓ Correct
(18:2) ✗ Wrong brackets
{18:2} ✗ Wrong brackets
[18-2] ✗ Wrong separator
[18.2]
2. Spaces in placeholder:
[18:2] ✓ Correct
[ 18:2 ] ✗ Spaces inside
[18 : 2]
3. Wrong table or field number:
[18:2] ✓ Correct (Customer Name exists)
[18:999] ✗ Field 999 doesn't exist in table 18
[999:2]
4. Linked table not configured:
If placeholder references table other than trigger table
Ensure table is in Source References
Ensure link filters are correct
Debugging:
Check Validation Log for placeholder resolution
Verify table and field numbers in Business Central
Verify linked table configuration
Test with simpler placeholder first
Problem: Placeholder Shows Blank or Zero
Symptoms: Placeholder resolves but shows empty value or zero
Possible causes:
1. Field is actually blank:
Verify field has value in the record
Check if field is populated at trigger event timing
2. Wrong field number:
Verify correct field number
Easy to confuse similar field names
3. Linked table filter doesn't match:
No matching record in linked table
Filter configuration error in Source References
4. Timing issue with Before Insert:
Field not yet populated when Before Insert fires
Some fields populated after insert
Use After Insert if needed
Debugging:
Check actual field value in Business Central
Verify field value exists at trigger timing
Test with different field that definitely has value
Review linked table filter configuration
Problem: Calculation Placeholder Shows Wrong Result
Symptoms: [36:109] + [18:61] shows incorrect total
Possible causes:
1. Order of operations:
[36:109] + [18:61] * 2
// Multiplication happens first: 18:61 * 2, then adds 36:109
Intended:
([36:109] + [18:61]
2. Division by zero:
[36:109] / [36:110]
// If field 110 is zero, may show error or infinity
Safe version:
[36:109] / ([36:110]
3. Data type mismatch:
Integer division truncates decimals
Check field data types
4. Field units mismatch:
[27:18] - [27:22]
Debugging:
Test each placeholder individually
Verify data types
Check field units
Use parentheses to control order
Test with known values
Problem: Placeholder in Email Not Resolving
Symptoms: Email received with literal [18:2] instead of customer name
Possible causes:
1. Email system doesn't support placeholders:
Verify QUALIA Rule Engine version supports placeholders in emails
Check documentation for email action capabilities
2. Email sent before placeholder resolution:
Timing issue in rule engine
May be bug or limitation
3. Email template vs. dynamic content:
Some systems distinguish between template and dynamic content
Verify correct field for dynamic content
Debugging:
Test with simple placeholder first
Check if any placeholders work in email
Review QUALIA Rule Engine documentation for email action
Test with Message action first (known to support placeholders)
Problem: Special Characters in Placeholder Value
Symptoms: Placeholder value contains quotes, brackets, or special characters causing display issues
Example:
Customer Name: "Bob's "Special" Company [LLC]"
Placeholder: [18:2]
Message: "Customer [18:2]
Solution:
QUALIA Rule Engine should handle this automatically
If issues occur, report as potential bug
Consider using different field (e.g., Customer No. instead of Name)
Best Practices for Using Placeholders
1. Always Provide Context
Poor:
Better:
"Credit limit $[18:59]Best:
"Credit limit exceeded. Customer [18:2] has credit limit $[18:59]
but this order $[36:109] plus current balance $[18:61] totals
$([36:109] + [18:61]), exceeding limit by $([36:109] + [18:61] - [18:59]
2. Show Both Problem and Solution
Poor:
Best:
"Credit limit exceeded. Customer [18:2] has credit limit $[18:59]
but this order $[36:109] plus current balance $[18:61] totals
$([36:109] + [18:61]).
To proceed:
- Reduce order amount to $([18:59] - [18:61]
3. Use Descriptive Text Around Placeholders
Poor:
"[18:2] [18:59] [18:61]
Best:
"Customer [18:2] has credit limit $[18:59] and current balance $[18:61]
4. Verify Placeholder Values Are Available
Check timing:
Before Insert: Some fields may not be populated yet
After Delete: Record no longer exists (may not have access to fields)
Linked tables: Ensure related record exists
Test thoroughly:
Test with actual data
Verify placeholders resolve correctly
Check edge cases (empty fields, zero values, etc.)
5. Format Numbers Appropriately
Currency:
"Amount: $[36:109]"
not
"Amount: [36:109]
Percentages:
"Discount: [([36:176] / [36:109]Quantities:
"Quantity: [37:15]6. Avoid Overly Complex Calculations
Poor (too complex):
"Value: [(([37:22] - [27:21]) * [37:15]) / (([27:22] + [27:23]
Better (use multiple placeholders):
"Unit margin: $([37:22] - [27:21])
Line margin: $(([37:22] - [27:21]) * [37:15])
Margin percentage: [(([37:22] - [27:21]) / [37:22]
7. Test Placeholders with Real Data
Don't assume placeholders work:
Create test transaction with known data
Verify placeholder shows expected value
Test with edge cases (blanks, zeros, large numbers)
Check formatting
8. Document Placeholder Meanings
In rule description, note what placeholders represent:
Rule: Credit Limit Check
Description: Validates order + balance doesn't exceed credit limit
Placeholders used:
[18:2] - Customer Name
[18:59] - Credit Limit (LCY)
[18:61] - Balance (LCY)
[36:109] - Amount Including VAT
Formula: {[36:109] + [18:61]} is >[18:59]9. Consistent Formatting Across Rules
Establish standard format for similar messages:
Credit-related messages always show:
"Customer [18:2] has credit limit $[18:59] and balance $[18:61]."
Discount-related messages always show:
"Discount of [DiscountPercent]% exceeds maximum authorized discount of [MaxPercent]
10. Use Placeholders in Email Subjects
Make emails identifiable at a glance:
Subject: "Order [36:3] Created: $[36:109]
Common Placeholder Patterns
Pattern 1: Credit Limit Message
"Credit limit exceeded. Customer [18:2] has credit limit $[18:59]
but current balance $[18:61] plus this order $[36:109] would total
$([18:61] + [36:109]), exceeding limit by $([18:61] + [36:109] - [18:59]).
Please:
- Reduce order to $([18:59] - [18:61]
Pattern 2: Discount Authorization
"Discount percentage [([36:176] / [36:109]) * 100]% exceeds maximum authorized
discount of 15% for salesperson [36:43].
Discount amount: $[36:176]
Order amount: $[36:109]
Please obtain manager approval or reduce discount to $([36:109]
Pattern 3: Inventory Warning
"Low inventory alert: Item [27:3] (Item No. [27:1]) has only [27:18] units
in stock, but this order requests [37:15] units.
This will create a backorder of ([37:15] - [27:18]) units.
Estimated fulfillment date: [EstimatedDate]
Pattern 4: Price Below Cost
"Price warning: Unit price $[37:22] is below unit cost $[27:21] for item [27:3].
Loss per unit: $([27:21] - [37:22])
Total line loss: $(([27:21] - [37:22]) * [37:15]
Pattern 5: Large Order Notification
Email Subject: "Large Order Alert: $[36:109]"
Email Body:
"A large order was created requiring your review:
Order No.: [36:3]
Customer: [18:2] ([18:1])
Amount: $[36:109]
Created By: [USERID]
Date: [36:99]
This order exceeds the typical order size of $[18:73] for this customer
by $([36:109] - [18:73]
Pattern 6: Customer Blocked
"Cannot process transaction. Customer [18:2] ([18:1]) is blocked for [18:40].
Current Status: [18:39]
Block Reason: [18:40]
Conclusion
Placeholders transform business rules from rigid, generic validations into intelligent, context-aware communications that empower users to understand and resolve issues independently.
Key principles:
Always use placeholders to:
Show specific data values
Explain exactly what's wrong
Provide actionable resolution steps
Reduce support burden
Master the syntax:
[TableNumber:FieldNumber]
No spaces inside brackets
Use calculations: ([36:109] + [18:61])
Verify table/field numbers
Design effective messages:
Explain the problem clearly
Show relevant data with placeholders
Provide specific resolution steps
Include contact information if needed
Test thoroughly:
Verify placeholders resolve correctly
Test with real data
Check edge cases
Validate calculations
Optimize for users:
Use clear, non-technical language
Format numbers appropriately (currency, percentages)
Structure messages logically
Be concise but comprehensive
By mastering placeholders, you transform error messages from frustrating roadblocks into helpful guides that enable users to solve problems efficiently and maintain productivity—creating business rules that users actually appreciate rather than merely tolerate.
Quick Reference: Common Business Central Tables
Related Reading:
Scenarios vs. Conditions: Mastering the Two-Tier Validation Model
Writing Effective Error Messages: User Experience Best Practices
Advanced Formula Techniques: Complex Business Logic Made Simple
Email Actions: Automated Notifications and Workflows
