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
- Custom Functions (defs)
Custom Functions (defs)
Updated by Scott Waldron
In addition to the Dino built-in functions, you can of course define your own functions. The keyword def is used to start a function definition.
def triassic() {
return 'T-Rex came later';
}
Functions are not required to return a value. A function body without a return statement will just return a special value known as null.
def nothing() {
}
var fossil = nothing(); // null
Functions can take any number of parameters. Parameters in Dino are dynamically typed; you do not specify what the type is – you simply use one or more identifiers.
def rex(name, age) {
// ...
}
Function Visibility
Functions can have private visibility so that they are not imported. By default, functions have public visibility. You can include the public keyword if you want, but it is not required.
// egg.dino
private def egg() {
return 'Only my mother can see me.';
}
print(egg()); // ok, we are in the script
def rex() {
return 'I can be seen by others.';
}
// outsideWorld.dino
import script 'egg.dino' as e;
print(e.rex()); // ok
print(e.egg()): // error, the egg function is privately defined in egg.dino
Functions as Variables
You can assign functions to variables and call them. This is often referred to as a delegate, and when passed as an argument to another function, a callback or function pointer.
def info(a) {
return a + ' is a big dino.';
}
private var delegate = info;
print(delegate('brontosaurus')); // 'brontosaurus is a big dino'
Nested Functions
Functions do not have to be declared in the global scope – they can be defined in any scope. Functions defined in a local scope such as another function body are always private visibility, and calling them outside of their local scope is an error.
def outside(a, b) {
def inside(c) {
return a + c;
}
return inside(b);
}
outside(4, 5); // 9
inside(3); // error, unknown symbol 'inside'
Parameter Defaults
Def statements may define “parameter defaults”, that is parameters that are considered optional from the call site and will have a default value if omitted.
def rex(a, b = 10) {
return a + b;
}
var a = rex(10); // a == 20
In Dino, all parameters are optional – missing arguments are simply set to null, and extra arguments are discarded and ignored. What this means is that setting a parameter to a default of null is technically not required, because the missing argument will cause the parameter to be set to null in any case.
def rex(a, b) {
}
rex(10); // ok, b will just be null
def rex(a, b = null) {
} // same as above for practical purposes
rex(10); // ok
rex(10, 20, 30, 40, 50); // last 3 args are discarded
Parameters with default values must come last in the parameter list. It is an error to define a parameter with a default value and follow it with another that does not have a default value.
def rex(a = 20, b) {
} // error
def raptor(a = 10, b = 15, c = 20, d = 25) {
} // ok, all params have defaults