Atlas Forms
Disabling Forms for a Tenant
A tenant can have a form hidden from their navigation and unavailable for loading by setting disable: true in a FormOverrideEntry. This creates a tenant-specific row in Atlas_Forms with IsActive = 0, while leaving the base form active for all other tenants.
How to Disable
// Disable the GuardRail_Audit dashboard (FormID 13007) for Tenant 9
// Tenant 9 has their own analytics platform and does not need the built-in dashboard
const acmeOverride: FormGroupOverride = {
baseCategoryId: 130,
tenantId: 9,
overrides: [
{
formId: 13007,
disable: true, // IsActive = 0 in the tenant row
}
],
additions: []
};
What Happens in the Database
-- Translated SQL for the disable override
-- Sets IsActive = 0 for Tenant 9 on FormID 13007
IF NOT EXISTS (
SELECT 1 FROM [dbo].[Atlas_Forms]
WHERE [FormID] = 13007 AND [TenantID] = 9
)
BEGIN
INSERT INTO [dbo].[Atlas_Forms]
([FormID], [FormCode], [FormCategoryID], [FormTypeID],
[PrimaryUsage], [NodeUsage], [TenantID], [IsActive], [SchemaJson])
VALUES
(13007, 'GuardRail_Audit', 130, 4,
'guardrails', NULL, 9, 0, -- IsActive = 0
N'{}'); -- Schema is irrelevant when IsActive = 0
END
Load-Time Behaviour for Disabled Forms
// Form loader — handling disabled tenant rows
async function loadForm(formId: number, tenantId: number | null): Promise<FormSchema | null> {
// Try to find a tenant-specific row
if (tenantId) {
const tenantRow = await db.query(
'SELECT IsActive, SchemaJson FROM Atlas_Forms WHERE FormID = @formId AND TenantID = @tenantId',
{ formId, tenantId }
);
if (tenantRow) {
if (!tenantRow.IsActive) {
// Form is disabled for this tenant — return null
return null;
}
// Tenant row exists and is active — merge with base
const baseRow = await db.query('SELECT SchemaJson FROM Atlas_Forms WHERE FormID = @formId AND TenantID IS NULL', { formId });
return parseSchema(deepMerge(JSON.parse(baseRow.SchemaJson), JSON.parse(tenantRow.SchemaJson)));
}
}
// No tenant row — return base form
const baseRow = await db.query('SELECT SchemaJson FROM Atlas_Forms WHERE FormID = @formId AND TenantID IS NULL', { formId });
return baseRow ? parseSchema(JSON.parse(baseRow.SchemaJson)) : null;
}
Navigation Hiding
The navigation system queries for active forms in the group for the current tenant. Disabled forms are excluded from the navigation automatically:
-- Query used to build the navigation tab for a tenant
SELECT FormID, FormCode, PrimaryUsage
FROM dbo.Atlas_Forms
WHERE FormCategoryID = 130
AND IsActive = 1
AND (TenantID IS NULL OR TenantID = 9)
AND FormID NOT IN (
SELECT FormID FROM dbo.Atlas_Forms
WHERE TenantID = 9 AND IsActive = 0
)
ORDER BY FormID;
Disabling vs Deleting
Never delete a form row from
Atlas_Forms — always use IsActive = 0. Deleted rows can be recreated on the next environment refresh from the deploy scripts. Disabled rows are preserved and can be re-enabled at any time by updating the tenant row's IsActive to 1.