Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Modifying Existing Pages

ALTER PAGE modifies widgets in place without recreating the entire page. This is useful for incremental changes, maintenance, and agent-driven iteration.

Change a Button

ALTER PAGE CRM.Customer_Edit {
  SET (Caption: 'Save & Close', ButtonStyle: Success) ON btnSave
};

Add a Field After an Existing One

ALTER PAGE CRM.Customer_Edit {
  INSERT AFTER txtEmail {
    TEXTBOX txtPhone (Label: 'Phone', Attribute: Phone)
  }
};

Add a Widget Into a Container

Use INSERT INTO to append a widget as a container’s last child — the only way to fill an empty container.

ALTER PAGE CRM.Customer_Overview {
  INSERT INTO ctnToolbar {
    ACTIONBUTTON btnNew (Caption: 'New Customer', Action: NOTHING, ButtonStyle: Primary)
  }
};

Remove Widgets

ALTER PAGE CRM.Customer_Edit {
  DROP txtLegacyField, lblOldNote
};
ALTER PAGE CRM.Customer_Edit {
  REPLACE dvMain.footer WITH {
    FOOTER {
      ACTIONBUTTON btnSave (Caption: 'Save', Action: SAVE CHANGES, ButtonStyle: Success)
      ACTIONBUTTON btnDelete (Caption: 'Delete', Action: DELETE, ButtonStyle: Danger)
      ACTIONBUTTON btnCancel (Caption: 'Cancel', Action: CANCEL CHANGES)
    }
  }
};

Multiple Changes at Once

ALTER PAGE CRM.Customer_Edit {
  SET (Title: 'Edit Customer Details');
  SET (Label: 'Email Address') ON txtEmail;
  INSERT AFTER txtPhone {
    TEXTBOX txtWebsite (Label: 'Website', Attribute: Website)
  };
  DROP lblInternalRef
};

Add a Page Variable

ALTER PAGE CRM.ProductOverview {
  ADD Variables $showStockColumn: Boolean = 'if (3 < 4) then true else false'
};

Add a Page Parameter

Add a parameter to an existing page without rewriting it. The page has a URL, so the new parameter gets a segment in the same statement:

ALTER PAGE CRM.Customer_Edit {
  SET (Url: 'customer-edit/{Customer}/{Order}');
  ADD Parameters $Order: CRM.Order
};

Switch Page Layout

Change a page’s layout without losing any widgets:

-- Switch from TopBar to Default layout (auto-maps by placeholder name)
ALTER PAGE CRM.Customer_Edit {
  SET Layout = Atlas_Core.Atlas_Default
};

When the new layout has different placeholder names, use MAP:

ALTER PAGE CRM.Customer_Edit {
  SET Layout = Atlas_Core.Atlas_SideBar MAP (Main AS Content, Extra AS Sidebar)
};

Modify DataGrid Columns

Target columns using dotted notation gridName.columnName:

mdl 1;
-- Add a column
ALTER PAGE CRM.Customer_List {
  INSERT AFTER dgCustomers.Email {
    COLUMN Phone (Attribute: Phone, Caption: 'Phone')
  }
};

-- Remove a column
ALTER PAGE CRM.Customer_List {
  DROP dgCustomers.OldNotes
};

-- Rename a column header
ALTER PAGE CRM.Customer_List {
  SET (Caption: 'E-mail Address') ON dgCustomers.Email
};

Use DESCRIBE PAGE CRM.Customer_List to discover column names.

Works on Snippets Too

ALTER SNIPPET CRM.NavigationMenu {
  SET (Caption: 'Dashboard') ON btnHome;
  INSERT AFTER btnHome {
    ACTIONBUTTON btnReports (
      Caption: 'Reports',
      Action: SHOW PAGE CRM.Reports_Overview
    )
  }
};