Table of Contents

Dynamic Attributes - Step-by-Step Tutorial

This hands-on tutorial will guide you through creating your first dynamic attributes in 3PL Dynamics. We'll start with simple examples and progress to more advanced scenarios.

🎯 Tutorial Objectives

By the end of this tutorial, you'll be able to:

  • Create basic field-based dynamic attributes
  • Set up calculated attributes using function sets
  • Configure FlowField-based attributes
  • Apply formatting and styling
  • Add attributes to page layouts
  • Monitor and optimize performance

📚 Prerequisites

  • Access to 3PL Dynamics with appropriate permissions
  • Basic understanding of Business Central navigation
  • Familiarity with the data you want to extend

🚀 Tutorial 1: Creating a Simple Field-Based Attribute

Let's start by creating a dynamic attribute that displays an existing field with custom formatting.

Scenario: Display Item Unit Cost with Custom Formatting

Goal: Show the unit cost of items with currency formatting and custom styling.

Step 1: Open Dynamic Attributes

  1. Press Alt+Q to open the search
  2. Type "Dynamic Attributes" and press Enter
  3. Click New to create a new attribute

Step 2: Basic Configuration

  1. Table No.: Enter 27 (Item table)
  2. Code: Enter UNIT_COST_FORMATTED
  3. Description: Enter Unit Cost (Formatted)
  4. Value Type: Select Decimal
  1. Field No.: Enter 22 (Unit Cost field)
  2. Notice that Is FlowField is automatically set to false

Step 4: Configure Formatting

  1. Decimals: Enter 0:2 (0 minimum, 2 maximum decimal places)
  2. Standard Format: Select No Thousand Separator

Step 5: Save and Test

  1. Click OK to save
  2. Navigate to an Item List page
  3. Check if your attribute appears in the available fields

🧮 Tutorial 2: Creating a Calculated Attribute

Now let's create an attribute that calculates a value using a simple formula.

Scenario: Calculate Item Profit Margin Percentage

Goal: Show profit margin as a percentage based on unit cost and unit price.

Step 1: Create the Attribute

  1. Open Dynamic Attributes
  2. Click New
  3. Table No.: 27 (Item table)
  4. Code: PROFIT_MARGIN_PCT
  5. Description: Profit Margin %
  6. Value Type: Decimal

Step 2: Set Up Function Set

  1. Value Function Set ID: Click the lookup (you'll need to create a function set)
  2. Create a simple calculation: (Unit Price - Unit Cost) / Unit Price * 100
  3. Save the function set and note its ID
  4. Enter the function set ID in the Value Function Set ID field

Step 3: Configure Display

  1. Decimals: Enter 0:1 (show as percentage with 1 decimal)
  2. Standard Format: Leave as default

Step 4: Add Performance Monitoring

  1. Track Performance Statistics: Select Yes (Session)
  2. Slow Calculation Threshold: Enter 100 (100 milliseconds)

📊 Tutorial 3: Creating a FlowField Attribute

Let's create an attribute that aggregates data from related tables.

Scenario: Show Total Quantity on Sales Orders

Goal: Display total quantity for all lines on a sales order.

Step 1: Create the Attribute

  1. Table No.: 36 (Sales Header table)
  2. Code: TOTAL_QUANTITY
  3. Description: Total Order Quantity
  4. Value Type: Decimal

Step 2: Configure FlowField

  1. Field No.: Select a FlowField that sums quantities from Sales Lines
  2. Is FlowField: Will be automatically set to true
  3. Calculate Field: Set to true

Step 3: Set FlowFilter (Optional)

You can filter which lines to include:

  1. FlowFilter Values: Enter Type=Item (only include item lines)

Step 4: Configure Caching

  1. Buffer Recalculation Interval: Enter 00:01:00 (1 minute)
  2. Entry Recalculation Interval: Enter 00:05:00 (5 minutes)

🎨 Tutorial 4: Adding Conditional Styling

Let's enhance our profit margin attribute with color coding.

Scenario: Color-Code Profit Margins

Goal: Show profit margins in green (good), yellow (average), or red (poor).

Step 1: Edit Existing Attribute

  1. Open your PROFIT_MARGIN_PCT attribute
  2. Go to the Style Function Set ID field

Step 2: Create Style Function Set

Create a function set that returns style names based on value:

IF Profit Margin >= 20 THEN 'Favorable'
ELSE IF Profit Margin >= 10 THEN 'Ambiguous'
ELSE 'Unfavorable'

Step 3: Apply the Style

  1. Enter the style function set ID
  2. Save the attribute

📋 Tutorial 5: Setting Up Layouts

Now let's control where our attributes appear on pages.

Step 1: Create an Attribute Layout

  1. Search for "Dynamic Attribute Layouts"
  2. Click New
  3. Table No.: 27 (Item table)
  4. Code: ITEM_DASHBOARD
  5. Description: Item Dashboard Layout

Step 2: Add Layout Lines

  1. From the layout card, click Lines

  2. Add a new line for each attribute:

    • Dynamic Attribute Code: UNIT_COST_FORMATTED
    • Display Order: 10
    • Value Type: Decimal
  3. Add another line:

    • Dynamic Attribute Code: PROFIT_MARGIN_PCT
    • Display Order: 20
    • Value Type: Decimal

Step 3: Associate with Page

  1. Search for "Dynamic Page Layouts"
  2. Find or create entry for Item table
  3. Set Dynamic Attr. Layout Code to ITEM_DASHBOARD

🔍 Tutorial 6: Testing and Validation

Let's verify our attributes are working correctly.

Step 1: View on Item List

  1. Navigate to the Item List page
  2. Look for your dynamic attributes in the field list
  3. Add them to your view if not already visible

Step 2: Test Calculations

  1. Select different items
  2. Verify the profit margin calculations are correct
  3. Check that styling is applied appropriately

Step 3: Check Performance

  1. Return to your Dynamic Attributes
  2. Open the PROFIT_MARGIN_PCT attribute
  3. Check the performance fields:
    • No. of Calculations
    • Total Elapsed Calc. Time
    • Max. Elapsed Calc. Time

🏢 Tutorial 7: Advanced Scenario - Warehouse KPIs

Let's create a more complex example for warehouse management.

Scenario: Location Utilization Dashboard

Goal: Show utilization percentage and status for warehouse locations.

Step 1: Create Utilization Percentage

  1. Table No.: Location table
  2. Code: UTILIZATION_PCT
  3. Description: Utilization %
  4. Value Type: Decimal
  5. Create function set to calculate: (Used Capacity / Total Capacity) * 100

Step 2: Create Status Indicator

  1. Code: UTILIZATION_STATUS
  2. Description: Utilization Status
  3. Value Type: Text
  4. Create function set that returns:
    • "Optimal" for 70-85% utilization
    • "Underutilized" for <70%
    • "Overcrowded" for >85%

Step 3: Add Visual Indicators

  1. Create style function sets for both attributes
  2. Use traffic light colors (green, yellow, red)

Step 4: Create Comprehensive Layout

  1. Create layout: WAREHOUSE_KPI
  2. Add all warehouse-related attributes
  3. Order them logically

🚨 Common Pitfalls and Solutions

Issue: Attribute Not Showing

Solutions:

  • Check if attribute is blocked
  • Verify table number matches page
  • Ensure layout is properly configured
  • Check user permissions

Issue: Slow Performance

Solutions:

  • Enable performance tracking
  • Increase caching intervals
  • Simplify function set logic
  • Add database indexes if needed

Issue: Incorrect Calculations**

Solutions:

  • Test function sets independently
  • Check FlowFilter syntax
  • Verify field mappings
  • Review data types

Issue: Styling Not Applied**

Solutions:

  • Verify style function set returns valid style names
  • Check conditional logic
  • Test with different data values
  • Review style definitions

🎓 Next Steps

Congratulations! You've learned the fundamentals of Dynamic Attributes. Here's how to continue your journey:

Immediate Actions

  1. Practice: Create attributes for your own business scenarios
  2. Experiment: Try different value types and formatting options
  3. Monitor: Set up performance tracking for production use

Advanced Topics

  1. Complex Function Sets: Learn advanced calculation techniques
  2. Multi-Table Attributes: Work with related table data
  3. Custom Page Integration: Add attributes to custom pages
  4. API Integration: Use attributes in web services

Best Practices

  1. Start Simple: Begin with basic field-based attributes
  2. Plan Performance: Consider caching and calculation complexity
  3. Document Logic: Keep clear notes on business rules
  4. User Training: Help your team understand new functionality

Resources

  • Boltrics Academy: Advanced training courses
  • Support Portal: Technical assistance
  • User Community: Share experiences and tips
  • Documentation: Detailed technical references

📝 Tutorial Checklist

Mark off each tutorial as you complete it:

  • [ ] Tutorial 1: Field-Based Attribute
  • [ ] Tutorial 2: Calculated Attribute
  • [ ] Tutorial 3: FlowField Attribute
  • [ ] Tutorial 4: Conditional Styling
  • [ ] Tutorial 5: Layout Configuration
  • [ ] Tutorial 6: Testing & Validation
  • [ ] Tutorial 7: Advanced Warehouse KPIs

Practice Exercises

Try creating these on your own:

  • [ ] Customer aging days calculation
  • [ ] Vendor payment terms status
  • [ ] Item stock level indicators
  • [ ] Order fulfillment percentage
  • [ ] Route efficiency metrics

Remember: Dynamic Attributes are powerful tools that grow with your expertise. Start with simple scenarios and gradually tackle more complex business requirements as you become comfortable with the functionality.