Visual map — Ch.01b · Dev options
Field/option decisions for ch.01
Decision register
Development
Full visual path (all chapters): VISUAL_FROM_SCRATCH_00_16.html
Decision register
Development
Full visual path (all chapters): VISUAL_FROM_SCRATCH_00_16.html
01 — Development Options — كل الحقول والبدائل (HR Leave)
Platform target: ServiceNow Australia (current family, Sep 2026) · next EA: Brazil
App: Custom · Scope x_786686_hr_leave · sys_id e5f5bc9493a303507520703efaba104d
URLs: ../SERVICENOW_DIRECT_URLS_CATALOG.html · 1-week: ../SERVICENOW_ONE_WEEK_STUDY_DEPLOY_AUSTRALIA.htmlCompanion to 01_DEVELOPMENT.md — use when fields, menus, or features differ on your instance.
Pattern hub: 00_TUTORIAL_OPTIONS_REFERENCE.md
App type: Custom · Scope: x_786686_hr_leave · sys_id: e5f5bc9493a303507520703efaba104d · Date created: 2026-09-09 20:20:55
1) Scope / Application — options
Option A — Studio (recommended)
Navigate: /now/studio → Create Application
| Field | Required | Value | Notes |
|---|---|---|---|
| Name | Yes | HR Leave | Display name |
| App type | Yes | Custom | Scoped custom application |
| Scope name | Yes | x_786686_hr_leave | Auto-generated prefix; cannot change |
| Date created | — | 2026-09-09 20:20:55 | From your instance |
| sys_id | — | e5f5bc9493a303507520703efaba104d | sys_app record |
| Version | No | 1.0.0 | Semantic versioning |
| Short description | No | Leave management scoped app | |
| Logo | No | optional |
Option B — From sys_app list (admin)
Navigate: sys_app.list → New (admin only; prefer Studio)
Option C — Personal Developer Instance template
Some PDIs ship HR samples — still create your scope to practice Update Sets.
After create — Application record fields
Navigate: All > System Applications > Applications → HR Leave — Open direct
| Field / related | Recommended | Options you forget |
|---|---|---|
| Trackable | true | Required for scoped Update Sets |
| Can read in public | false | Internal HR app |
| Application Access | Restrict to roles | employee, manager, hr_admin |
| Runtime Access | Same as design | |
| Menu | Auto from modules | Classic UI app menu |
| Source control | Optional Git | Studio → Source Control |
Common errors
| Error | Fix |
|---|---|
| Tables created in Global | Switch app picker → HR Leave → recreate |
| Cannot delete scope | Expected — scope is permanent |
2) Tables — options
Option A — Studio → Table
| Field | Required | Example req_v2 |
|---|---|---|
| Label | Yes | Leave Request |
| Plural | No | Leave Requests |
| Name | Yes | x_786686_hr_leave_req_v2 |
| Extends | No | blank or task (if you want task features) |
| Create module | Yes | true — adds app menu link |
| Auto-number | Optional | Prefix LRX |
Option B — Extend task (alternative design)
| Pros | Cons |
|---|---|
| SLA, assignment OOTB | Heavier; mixes with ITSM patterns |
| Familiar to ITSM devs | More ACL overlap |
Our app: standalone tables (no extend) — simpler for learning.
Option C — Import from XML / Studio
Files: SCHEMA_AND_DATA.html, STUDIO_CREATE_ALL_OBJECTS_01_16.html, 11 Studio practice
Field (Dictionary) — all options to know
Navigate: field → Configure Dictionary
| Option | When to use |
|---|---|
| Mandatory | Always required |
| Read only | Calculated (u_days_count) |
| Default value | draft for state |
| Reference qual | Active users only |
| Choice | u_leave_type, u_state |
| Max length | Strings |
| Display | Reference display field |
Instance note
- Dictionary Entries vs Table Columns — same data, two UIs.
- Scope on dictionary must match table scope.
3) Script Includes — options
Option A — Studio → Script Include
| Field | Value |
|---|---|
| Name | HRLXProLeaveUtilsV2 |
| API Name | same |
| Client callable | false (server) / true (GlideAjax) |
| Accessible from | All application scopes / This scope only |
| Active | true |
Files: src/server/script_includes/*.js
Option B — Global Script Include (avoid)
Only for shared platform utilities — keep HR logic in scope.
Client callable variant
| Field | Value |
|---|---|
| Client callable | true |
| Use with | GlideAjax from Client Script |
4) Business Rules — options
Navigate: Studio → Business Rule OR sys_script.list
| Field | Required | BR1 example |
|---|---|---|
| Name | Yes | HRLX Calculate Days and Approver |
| Table | Yes | x_786686_hr_leave_req_v2 |
| Active | Yes | true |
| Advanced | Often true | when using current/previous |
| When | Yes | before / after / async |
| Insert | true/false per BR | |
| Update | true | |
| Delete | usually false | |
| Filter conditions | Recommended | u_state changes, etc. |
| Order | lower runs first (100, 200…) | |
| Run as | Optional | system user for elevated ops |
When to use which
| When | Use |
|---|---|
| before | Calculate fields, validate, block save |
| after | Events, audit, related records |
| async | Long work — avoid blocking save |
Option B — Flow instead of BR
Use Flow for approvals; BR for short table logic.
Option C — Data Policy
Mandatory/read-only without script — all channels.
Files: src/server/business_rules/BR*.js
5) Client Scripts — options
| Field | CS1 example |
|---|---|
| Name | HRLX Validate Dates |
| Type | onChange / onSubmit / onLoad |
| Table | x_786686_hr_leave_req_v2 |
| Field | u_start_date (onChange) |
| UI Type | 10 desktop / mobile / both |
| Active | true |
Type guide
| Type | When |
|---|---|
| onChange | Instant validation |
| onSubmit | Last check before save |
| onLoad | Default values, hide fields |
Option B — UI Policy (no code)
See §7 — prefer for show/hide/mandatory.
Option C — Declarative (UXF)
Newer forms — check if workspace uses UI Policy equivalents.
6) UI Policies — options
Navigate: sys_ui_policy.list
| Field | Example |
|---|---|
| Table | x_786686_hr_leave_req_v2 |
| Conditions | u_leave_type is sick |
| Reverse if false | true (usually) |
| Run scripts | false (prefer actions) |
| On load | true |
UI Policy Actions
| Action | Effect |
|---|---|
| Visible | show/hide field |
| Mandatory | require field |
| Read only | lock field |
File: src/client/ui_policies/UIP1_sick_requires_reason.md
7) Flow — options
Full steps: src/flow/approval_flow.md
Option A — Flow Designer (recommended)
| Setting | Value |
|---|---|
| Trigger | Record Updated (not Created only) |
| Table | x_786686_hr_leave_req_v2 |
| Condition | u_state is submitted |
| Action | Ask For Approval |
| Rules | Anyone approves (mandatory) |
| End | Publish (not Save only) |
Option B — Legacy Workflow (avoid for new)
Still on old instances — migrate to Flow.
Option C — Approval Policy / CAB
ITSM pattern — overkill for single manager leave.
Common errors
| Error | Fix |
|---|---|
| Rules missing on action 1 | Rules → Anyone approves |
| Flow never starts | Trigger = Updated + state submitted |
| Double approval | Trigger condition too broad |
8) Integration — options
Full: 12_INTEGRATION_FULL_GUIDE.md
Inbound all fields: src/server/rest/SCRIPTED_REST_INBOUND_SETUP.md
Outbound all fields: src/server/rest/OUTBOUND_REST_MESSAGE_SETUP.md
| Path | Tool | When |
|---|---|---|
| A | REST API Explorer + Table API | sys_ids known |
| B | REST API Explorer + Scripted REST | employee_id from HRIS |
| C | Import Set | Bulk employees/balances |
| D | IntegrationHub | Orchestration + spokes |
| E | MID | On-prem ERP |
| Outbound | REST Message → POST Push Decision → Send | ERP push (not Explorer) |
Never skip: Explorer Send (inbound) before Postman; REST Message Send (outbound) before Flow.
9) Application Menu / Modules — options
Option A — Studio → Module
| Field | Example |
|---|---|
| Title | Leave Requests |
| Link type | List of Records |
| Table | x_786686_hr_leave_req_v2 |
| Order | 100, 200… |
| Roles | hr_admin, manager |
| Condition | optional filter query |
Option B — sys_app_module list
Classic admin — same fields.
Option C — Workspace only (no classic module)
Modern agents — UI Builder workspace + excluded classic menu.
10) Notifications & Events — options
| Option | Navigate |
|---|---|
| Event registry | sysevent.list |
| Notification | sysevent_email_action.list |
| Email script | Template + $mail_script |
| Flow notification | Flow Designer action |
Files: 06_NOTIFICATIONS_EVENTS_JOBS.md, src/server/events/events.md
Cross-cutting — deployment options
| Option | Use |
|---|---|
| Update Set | Instance → instance (classic) |
| XML export | Single artifact |
| Source Control / Git | Team dev |
| CI/CD pipeline | Enterprise |
Admin detail: 02_ADMINISTRATION.md §8
HR Leave — master dev checklist
- [ ] App scope x_786686_hr_leave active in picker
- [ ] 4 tables + choices from schema/*.csv
- [ ] 3 Script Includes active
- [ ] BR1/2/3 order and filters correct
- [ ] Client scripts + UI policies on form
- [ ] Flow published with Anyone approves
- [ ] Integration: Explorer 201 on Table or Scripted REST
- [ ] Modules visible to correct roles
- [ ] Update Set complete