Problem
CREATE OR REPLACE NAVIGATION requires a full replacement of the navigation profile. Adding or removing a single menu item means:
DESCRIBE NAVIGATION Responsive — read current state
- Manually edit the full menu tree
CREATE OR REPLACE NAVIGATION Responsive ... — write it back
This round-trip is error-prone and verbose for small changes.
Proposed Solution
Add ALTER NAVIGATION with incremental operations, consistent with the existing ALTER PAGE / ALTER ENTITY / ALTER SNIPPET pattern.
Syntax
ALTER NAVIGATION Responsive {
-- Add a top-level menu item
ADD MENU ITEM 'Reports' PAGE MyModule.Reports_Overview;
-- Add into a named sub-menu (multi-level: 'Parent > Child')
ADD MENU ITEM 'Detail' PAGE MyModule.Reports_Detail IN 'Reports';
-- Add a sub-menu group
ADD MENU 'Settings' (
MENU ITEM 'Users' PAGE Administration.Account_Overview;
MENU ITEM 'Config' PAGE MyModule.Config_Edit;
);
-- Remove by caption (exact match, case-sensitive)
REMOVE MENU ITEM 'Old Feature';
-- Remove with path disambiguation
REMOVE MENU ITEM 'Orders' IN 'Admin';
-- Change home/login page without touching menu structure
SET HOME PAGE MyModule.NewHome;
SET LOGIN PAGE Administration.Login;
}
Path Disambiguation
IN 'Parent' — appends to the named sub-menu
IN 'Parent > Child' — multi-level path, separated by >
- No
IN — operates at the top level
Error Handling
| Condition |
Behavior |
| Target PAGE/MICROFLOW not found |
Error (consistent with existing commands) |
IN path not found |
Error: Menu 'Parent > Child' not found |
REMOVE caption not found |
Error (no silent failure) |
REMOVE caption ambiguous (multiple matches) |
Error: suggest using IN to disambiguate |
ADD duplicate caption under same parent |
Error |
| Profile name not found |
Error (consistent with existing commands) |
| Multiple operations, failure mid-way |
Full rollback, original menu unchanged |
Compatibility
CREATE OR REPLACE NAVIGATION remains unchanged — full-replacement workflow still works
ALTER NAVIGATION is purely additive to the command set
- References validated by
mxcli check --references (PAGE/MICROFLOW targets)
Motivation
When building or updating a Mendix app via MDL scripts, navigation changes are frequent and typically involve one or two items at a time. A fine-grained ALTER NAVIGATION command would make scripts shorter, safer, and easier to review — matching the ergonomics already established by ALTER PAGE.
Problem
CREATE OR REPLACE NAVIGATIONrequires a full replacement of the navigation profile. Adding or removing a single menu item means:DESCRIBE NAVIGATION Responsive— read current stateCREATE OR REPLACE NAVIGATION Responsive ...— write it backThis round-trip is error-prone and verbose for small changes.
Proposed Solution
Add
ALTER NAVIGATIONwith incremental operations, consistent with the existingALTER PAGE/ALTER ENTITY/ALTER SNIPPETpattern.Syntax
ALTER NAVIGATION Responsive { -- Add a top-level menu item ADD MENU ITEM 'Reports' PAGE MyModule.Reports_Overview; -- Add into a named sub-menu (multi-level: 'Parent > Child') ADD MENU ITEM 'Detail' PAGE MyModule.Reports_Detail IN 'Reports'; -- Add a sub-menu group ADD MENU 'Settings' ( MENU ITEM 'Users' PAGE Administration.Account_Overview; MENU ITEM 'Config' PAGE MyModule.Config_Edit; ); -- Remove by caption (exact match, case-sensitive) REMOVE MENU ITEM 'Old Feature'; -- Remove with path disambiguation REMOVE MENU ITEM 'Orders' IN 'Admin'; -- Change home/login page without touching menu structure SET HOME PAGE MyModule.NewHome; SET LOGIN PAGE Administration.Login; }Path Disambiguation
IN 'Parent'— appends to the named sub-menuIN 'Parent > Child'— multi-level path, separated by>IN— operates at the top levelError Handling
INpath not foundMenu 'Parent > Child' not foundREMOVEcaption not foundREMOVEcaption ambiguous (multiple matches)INto disambiguateADDduplicate caption under same parentCompatibility
CREATE OR REPLACE NAVIGATIONremains unchanged — full-replacement workflow still worksALTER NAVIGATIONis purely additive to the command setmxcli check --references(PAGE/MICROFLOW targets)Motivation
When building or updating a Mendix app via MDL scripts, navigation changes are frequent and typically involve one or two items at a time. A fine-grained
ALTER NAVIGATIONcommand would make scripts shorter, safer, and easier to review — matching the ergonomics already established byALTER PAGE.