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: Returning JSON Data
A: Returning JSON Data
Updated by Scott Waldron
Dynamic objects, even hierarchies of dynamic objects, can be easily converted to JSON using the Newtonsoft JSON class library. Lists that are properties of the dynamic object will become arrays in the resulting JSON data.
/**
Command function showing hierarchical JSON data.
*/
def cmdGetJSON(strFormatting) {
$$
<param name="strFormatting"
selections="Indented,None"
help="Select how to format the JSON output" />
$$
from System import Random;
from Newtonsoft.Json import JsonConvert, Formatting;
const grandchildren = list(
'Bobby',
'Suzy',
'Karen',
'Jane',
'Melissa',
'Samuel',
'Liam',
'Sydney'
);
const gcount = grandchildren.Count;
const rand = Random();
const count = 3;
var root = dynamic();
root.Name = 'Root';
root.Value = 0;
root.Children = list();
repeat i 1 to count {
var parent = dynamic();
root.Children.Add(parent);
parent.Name = 'Parent' + i;
parent.Value = i;
parent.Children = list();
repeat j 1 to count {
var child = dynamic();
parent.Children.Add(child);
child.Name = 'Child' + j;
child.Value = i * j;
child.Children = list();
repeat k 1 to count {
var grandchild = dynamic();
child.Children.Add(grandchild);
grandchild.Name = grandchildren[rand.Next(gcount)];
grandchild.Value = i * j * k;
grandchild.Children = list();
}
}
}
var format = strFormatting == 'None' ?
Formatting.None : Formatting.Indented;
return JsonConvert.SerializeObject(root, format);
}
This command will create a hierarchy of JSON data. Each level will have a list property called Children that contains other dynamic objects. The last level also contains the list, so that each level has the same properties. A data structure like this could be used to show a treeview or a menu, for example.
More than likely, rather than hard coding the creation of the hierarchy, you would instead use a function that would be called recursively to "treeify" the data.