Wheelhouse®
QuickBooks Online Integration
Custom Fields and Forms
System Administration
Troubleshooting Checklist
Document Auto Number Format
Sale Shipment Records and Tracking Information Emails
Peripherals and Equipment Requirements
Navigation and Definitions
Understanding Order Flow in Wheelhouse
Understanding People and Organizations in Wheelhouse
Admin List Views and Single Record Views
Document Categories
Logging In and Getting Started
Left Menu Navigation
Advanced Search Techniques
User Administration
User Management: Adding, Editing, and Revoking Access
User Profiles and Roles
Choosing a User Profile
Defining or Adjusting Teams
Understanding Wheelhouse Login Types
Reports, Import, Exports, and Document Templates
Running Reports
Creating Reports on Quotes, Sales, and Outside Reps
Exporting to Excel
Preparing Excel and Word Templates for Data Merge
Quality Mangement
Adding QCIR Templates
QC Non Conformance Reports (NCRs)
Adding Quality Control Inspection Records (QCIR) in Shop Work
Order Management
Creating customers, quotes and sales
Order Management Guide
Adding Dealer and Outside Rep Logins
Using Order Flags and the Flag First Configs Option
Closing a Sale
External Agent Access Levels
Printing and Emailing Quotes and Sales
Production Routing and Tracking
Shop Work and QR Scanning
Shop Work: Priority Flags and Fixed Position
Merge Line Items at a Certain Step (Stash & Merge Functionality)
Stopping Work Center or All Running Operations at the End of the Shift
Bin Locations
Shop Work
Viewing/Adding/Resolving Work Order Issues
Production Scheduling
Labor Routings
Production Definitions
External Connections - API
Items and Configurators
Product Configuration in Wheelhouse
Item Overrides: Name, Pricing, and Discounts
Public Item Selector AKA Public Display Categories
Deploying A Configurator to Another Environment
Item and BOM Import Action
Wheelhouse Change Log
Table of Contents
Dino Script® Language Reference
Appendix A: Trestle®/Dino Script® Integration
A: Table of Contents
A: Commands
A: Dynamic and DynamicProxy
A: Advanced Command Arguments
A: Introduction
A: Files
A: Direct Links - URLs and Downloads
A: Running SQL Queries
A: NPOI and Excel, DocX and Word
A: Embedded Apps with MS Access Files
A: Returning JSON Data
A: Host and Target
A: Command Arguments
A: Creating/Running a Command
Adding New Functionality with Dino Script XCommand™
Introduction
Dino Script™ Table of Contents
Operators
Concepts
Syntax
Expression Types
Keywords
Variables
Blocks and Scopes
Built-In Functions
Custom Functions (defs)
Anonymous Functions
Conditional Statements
The Context Object
FAQ
Dino Cookbook
Sandbox In-Depth
Functions as Delegates
Style Guidelines
Native Types
Aliasing
Other Dino Scripts
- All Categories
- Dino Script® Language Reference
- Appendix A: Trestle®/Dino Script® Integration
- A: Dynamic and DynamicProxy
A: Dynamic and DynamicProxy
Updated by Scott Waldron
Dynamic Properties and the DynamicProxy Class
Dino Scripts™ are ideal for reporting. However, just returning a set of built-in objects is rarely enough to generate a report that will make sense to the end user. Database objects are by nature "normalized". Running a sales report with only Sale objects may show things like who the customer is, when the order was placed, etc., but will lack all the information about what items were purchased. In a normalized data structure, the items in a sale are stored in a separate table (thus in a separate object).
The .NET framework can be used for dynamic programming. While the .NET framework is a statically typed system, there are "syntactic sugar" allowances that give a very convincing impression of a dynamic, loosely typed system like Dino. For example, the following code will build (and run!) in C#:
namespace MyTests
{
public class MyClass
{
public MyClass()
{
dynamic d = new Trestle.DynamicProxy();
d.Name = "Jane Witherspoon";
d.Age = 34;
d.ThisIsCool = true;
}
}
}
The DynamicProxy class (in the Trestle® assembly and namespace) is an implementation of the .NET dynamic meta object system. In the code above, by declaring the variable as dynamic, the C# parser and validator know that they should not try to check for the existence of properties at compile time.
How Dino Script™ uses DynamicProxy
The Dino language has a dynamic() function. The language has a provision for making this function pluggable, that is systems that integrate the Dino language can provide their own dynamic object, provided it meets the interface requirements for a dynamic class in the .NET framework. In the ExpressionEvaluator class in Dino.Core, there is this code to enable this behavior:
/// <summary>
/// Set this to return a certain type of dynamic.
/// </summary>
public Func<IDynamicMetaObjectProvider> DynamicFactory
{
get;
set;
}
/// <summary>
/// Do NOT return ExpandoObject for this! It will break
/// public indexing. By default this method creates a
/// <see cref="Dynamitey.DynamicObjects.Dictionary"/>.
/// </summary>
/// <returns></returns>
public virtual IDynamicMetaObjectProvider CreateDynamicInstance()
{
return DynamicFactory?.Invoke() ??
new Dynamitey.DynamicObjects.Dictionary();
}
As you can see from the return value, the default implementation of this is 1) first check to see if the DynamicFactory property returns anything, and if not then 2) return a dynamic object which is defined in one of the dependencies that Dino already uses. By doing this, we prevent Dino from needing to take another dependency simply to return a dynamic object implementation.
When Dino is used with Trestle, we inject the creation function into ExpressionEvaluator like this:
//...
ExpressionEvaluator.Current.DynamicFactory = () => new DynamicProxy();
//...