Getting Started

Set up your development environment and create your first P9 object in under 5 minutes.

Quick Start

Prerequisites

  • A Tuli instance (cloud or self-hosted)
  • Admin or Developer role access
  • A text editor (VS Code recommended with P9 extension)

Step 1: Access the P9 Studio

Navigate to Settings → P9 Studio in your Tuli instance. The P9 Studio is a browser-based IDE for creating and managing P9 definitions.

Step 2: Create Your First Object

Create a new file called equipment.model with the following content:

@object Equipment
@application FacilityManagement
@icon "tool-icon"
@group "Assets"

field Number type:Autonumber format:"EQP-{yy}-#" label:"Code" search-filter:true
field Name type:Text label:"Equipment Name" required:true search-field:true
field Category type:Select label:"Category" required:true
field Location type:Lookup label:"Building" optional:true advance-search:true
field SerialNumber type:Text label:"Serial Number" optional:true unique:true
field PurchaseDate type:Date label:"Purchase Date" optional:true
field WarrantyExpiry type:Date label:"Warranty Expiry" optional:true
field Status type:Select label:"Status"

select Category {
	label:"HVAC" value:"HVAC" default:true
	label:"Electrical" value:"Electrical"
	label:"Plumbing" value:"Plumbing"
	label:"Fire Safety" value:"FireSafety"
	label:"Elevator" value:"Elevator"
}

select Status {
	label:"Active" value:"Active" default:true
	label:"Under Maintenance" value:"UnderMaintenance"
	label:"Retired" value:"Retired"
	label:"Disposed" value:"Disposed"
}

lookup Location {
	lookupobjectname:"Building"

	displayfield {
		"Name"
		"Number"
	}

	filter {
		Status="Active"
	}
}

@layout
form {
	create {
		title:"Create Equipment"
		savebuttontext:"Save"
		cancelbuttontext:"Cancel"

		section {
			title:"Equipment Details"
			subtitle:"Basic information"

			row {
				layout:6,6
				fields Number,Name
			}

			row {
				layout:6,6
				fields Category,Location
			}
		}

		section {
			title:"Serial & Dates"
			subtitle:"Tracking information"

			row {
				layout:6
				fields SerialNumber
			}

			row {
				layout:6,6
				fields PurchaseDate,WarrantyExpiry
			}
		}

		section {
			title:"Status"
			subtitle:"Current status"

			row {
				layout:6
				fields Status
			}
		}
	}

	list {
		mobile {
			fields Number,Name,Category,Status
		}

		desktop {
			fields Number,Name,Category,Location,SerialNumber,WarrantyExpiry,Status
		}
	}
}

Step 3: Deploy

Click Deploy in P9 Studio or run:

./setup

Step 4: Verify

Navigate to Facility Management → Equipment in the main application. You should see:

  • A list view with all defined fields as columns
  • A create form with the layout you specified
  • Search and filter capabilities
  • Export and import options

What Just Happened?

From your P9 definition, the platform automatically generated:

  • Database tables with proper schema and indexes
  • REST API endpoints (GET /api/v1/equipment, POST /api/v1/equipment, etc.)
  • List view, detail view, and create/edit forms
  • Search integration with full-text search
  • Audit logging for all field changes
  • RBAC hooks for permission checking
  • ClickHouse warehouse table for analytics

P9 Syntax Basics

P9 uses inline attribute syntax with colon-separated key-value pairs:

field FieldName type:FieldType label:"Display Label" required:true

Key syntax elements:

  • Decorators: @object, @application, @icon, @group
  • Field definitions: field Name type:Type label:"Label" attribute:value
  • Select blocks: select FieldName { label:"Option" value:"Value" }
  • Lookup blocks: lookup FieldName { lookupobjectname:"Object" displayfield { } }
  • Layout blocks: @layout form { create { section { row { } } } }

Next Steps

Experience the Platform

See how P9 and the Tuli platform work together

Ready to Build with P9?

Get hands-on with the platform. See how P9 accelerates your development workflow and integrates seamlessly with your existing systems.