
There is no "Out of the Box" (no-code) configuration to dynamically switch the active form based on a specific column value (like "Account Record Type") in the Unified Interface. Form visibility is typically controlled by Security Roles, but dynamic switching based on data requires JavaScript.
To achieve this, you must use the formContext.ui.formSelector.navigate() method from the Client API.
JavaScript Solution
Create a JavaScript Web Resource with the following function. This code checks the "Account Record Type" and navigates to the correct form if it is not already currently active.
function navigateToFormBasedOnType(executionContext) {
var formContext = executionContext.getFormContext();
// 1. Get the value of the 'Account Record Type' column
// Replace 'new_accountrecordtype' with your column's logical name
var recordType = formContext.getAttribute("new_accountrecordtype") ? formContext.getAttribute("new_accountrecordtype").getValue() : null;
// 2. Define the Target Form ID based on the value
// You can find the Form ID in the URL when editing the form
var targetFormId = "";
// Example: Check for specific Choice/OptionSet values (e.g., 100, 101)
if (recordType === 100) {
targetFormId = "00000000-0000-0000-0000-000000000000"; // Insert GUID for Form A
} else if (recordType === 101) {
targetFormId = "11111111-1111-1111-1111-111111111111"; // Insert GUID for Form B
}
// 3. Navigate only if a target is identified and we are not already there
if (targetFormId) {
var currentForm = formContext.ui.formSelector.getCurrentItem();
if (currentForm.getId().toLowerCase() !== targetFormId.toLowerCase()) {
var formItem = formContext.ui.formSelector.items.get(targetFormId);
if (formItem) {
formItem.navigate();
}
}
}
}
Steps: