Version:

Modify the Tabs on an Existing Page

The AlterTabs element allows you to modify an existing page's tabs without directly editing the spec for that page. When you include the AlterExistingPages element on a spec, you can then include the child AlterTabs element to edit existing tabs on the target page or to add new tabs. Within tabs, you can add or edit section, add or remove actions, redirect users to other pages, and perform a variety other options.

Note: For existing tabs, you cannot add or edit second-tier tabs. But when you create new tabs with the AddTab element, you can also create second-tier tabs.

Note: Starting with version 4.0 service pack 3, you can manage second-tier tabs for existing top-level tabs. Prior to this service pack, you could not add or edit second-tier tabs for existing top-level tabs. (Although when you created new top-level tabs, you could include second-tier tabs.)

For example, you can use the AlterTabs element and its child elements to add an action to an existing tab. After you identify the page with its GUID in the AlterPage element's PageID attribute, you can insert the AlterTabs element. Then you can identify the tab to edit by its GUID in the AlterTab element's TabID attribute. Next, you can insert the AlterSections element. Within that element, you can identify the data list and section to edit by their GUIDs in the AlterDataListSection element's DataListID and SectionID attributes.

Then to add an action to the section, you can add the AlterActions and AddAction elements. Within the AddAction element, you can insert an Action element and provide a caption and GUID for the new action. And within that element, you can specify the purpose of the action. For example, you can add the ExecuteRecordOperation element to create an action that executes a record operation and then provide a GUID for the record operation with the RecordOperationID element.

<AlterExistingPages>
<AlterPages>
<AlterPage PageID="edafd74a-b523-4842-8fd7-6a925d232b58">
<AlterTabs>
<AlterTab TabID="DC2B0F56-B909-425D-AE7C-A9C5CBB8DCE1">
<AlterSections>
<AlterDataListSection DataListID="15368371-ebb9-4e74-8ed0-6933f193b836" SectionID ="6622B62E-ED19-45DC-B0DC-9C3E9557078D">
<AlterActions>
<AddAction>
<Action Caption="New Tab Action" ID="648CADE5-7D49-4CAE-A622-C03B4BC237E0">
<common:ExecuteRecordOperation RecordOperationID="6888526B-72DE-42C0-B45B-3AC35FD12EDD" />
</Action>
</AddAction>
</AlterActions>
</AlterDataListSection>
</AlterSections>
</AlterTab>
</AlterTabs>
</AlterPage>
</AlterPages>
</AlterExistingPages>

With these lines in your new spec, you can add an action to a section on an existing page's tab without touching the spec for the page.

As another example, you may want to create an entirely new tab for a page. To do this, you can add the AddTab element instead of the AlterTab element within the AlterTabs element. You can then add the Tab element and use its Caption, ID, and Visible attributes to provide a caption and GUID and specify whether the tab is visible. Then you can then add the Sections element and its child Section element, where you can specify an GUID and caption for the section with the ID and Caption attributes. Next, you can specify the GUID for the section's data list with the ID attribute of the DataList element. And within that element, you can insert the RenderStyle element and its child StandardView element to specify a render style for the data list.

<AlterExistingPages>
<AlterPages>
<AlterPage PageID="edafd74a-b523-4842-8fd7-6a925d232b58">
<AlterTabs>
<AddTab>
<Tab Caption ="New tab" ID="5B64D7D7-ED72-4142-B985-37CB5C7298FC" Visible="true">
<Sections>
<Section Caption="New tab section" ID="9BEA1E81-D527-4248-92EA-6ADB49D0B1CF">
<DataList ID="">
<RenderStyle>
<StandardView></StandardView>
</RenderStyle>
</DataList>
</Section>
</Sections>
</Tab>
</AddTab>
</AlterTabs>
</AlterPage>
</AlterPages>
</AlterExistingPages>

In this example, if you don't want the standard view render style, you can use the GroupedView, RelationalView, or RepeaterView elements instead.