Wheelhouse®
Shopping Cart
QuickBooks Online Integration
QuickBooks Online Integration Setup and Troubleshooting
QuickBooks Online (QBO) Integration Overview
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
Logging In and Getting Started
Understanding Order Flow in Wheelhouse
Document Categories
Understanding People and Organizations in Wheelhouse
Admin List Views and Single Record Views
Left Menu Navigation
Advanced Search Techniques
User Administration
User Management: Adding, Editing, and Revoking Access
Defining or Adjusting Teams
User Profiles and Roles in Wheelhouse
Choosing a User Profile
Understanding Wheelhouse Login Types
Reports, Import, Exports, and Document Templates
Report Manager Guide
How to Modify Document Templates
Preparing Excel and Word Templates for Data Merge
Running Reports
Creating Reports on Quotes, Sales, and Outside Reps
Exporting to Excel
Quality Mangement
Adding QCIR Templates
QC Non Conformance Reports (NCRs)
Adding Quality Control Inspection Records (QCIR) in Shop Work
Order Management
Using Order Flags and the Flag First Configs Option
Order Management Guide
Creating customers, quotes and sales
Adding Dealer and Outside Rep Logins
Closing a Sale
External Agent Access Levels
Printing and Emailing Quotes and Sales
Production Routing and Tracking
Shop Work and QR Scanning
Merge Line Items at a Certain Step (Stash & Merge Functionality)
Bin Locations
Shop Work: Priority Flags and Fixed Position
Stopping Work Center or All Running Operations at the End of the Shift
Shop Work
Viewing/Adding/Resolving Work Order Issues
Production Scheduling
Job Manager Guide: Creating Jobs and Work Orders
Workflow Guide: Completing Work Order Operations
The Gantt View
Job Scheduler
Labor Routings
Production Definitions
External Connections - API
Items and Configurators
Product Configuration in Wheelhouse
Item Types
Build Types
Item Overrides: Name, Pricing, and Discounts
Public Item Selector AKA Public Display Categories
Deploying A Configurator to Another Environment
Item and BOM Import Action
Introduction to Kanban Inventory Management
Setting Up Inventory Replenishment and Purchasing
Inventory Hub Guide
Can I use Wheelhouse as my CRM?
Wheelhouse Change Log
Table of Contents
Dino Script® Language Reference
Appendix A: Trestle®/Dino Script® Integration
A: Returning JSON Data
A: Host and Target
A: Running SQL Queries
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: NPOI and Excel, DocX and Word
A: Embedded Apps with MS Access Files
A: Command Arguments
Style Guidelines
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
Native Types
Aliasing
Other Dino Scripts
- All Categories
- Dino Script® Language Reference
- Custom Functions (defs)
Custom Functions (defs)
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'; } Function…
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(); // nullFunctions 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.dinoFunctions 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 == 20In 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 nulldef rex(a, b = null) {
} // same as above for practical purposes
rex(10); // ok
rex(10, 20, 30, 40, 50); // last 3 args are discardedParameters 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
How did we do?
Built-In Functions
Anonymous Functions