Enable Versioning for List Item
- Last UpdatedJun 25, 2024
- 8 minute read
AVEVA Work Tasks allows its users to create different versions for a list item which is mapped to multiple tables (parent and child). The information in the parent table is considered as an identifier and is not versioned. All child table information is versioned.
In case of Employee Details, the parent table contains the parent items, Employee Name and Employee No. This list is not version enabled until a child list is added.
Versioning can be enabled for a child table with a single row of data and for a child table with multiple rows of data. In this scenario, first you will see how a child table with one record can be version enabled and the second scenario deals with a child table with multiple records.
Assume that you are creating an Employee Details list with the following table schema.
Table Employee Details with fields
-
EmployeeName
-
EmployeeNo
Table Address with fields
-
CurrentAddress
-
PermanentAddress
Also assume that, to map the list you have two tables Employee Details and Address in your database.
To create the Employee Details list
-
On the Manage List page, click New. The Create List window is displayed.
-
Enter the Title as Employee Details.
-
Enter any description to identify your list.
-
Select Yes for Is Folder Supported? option to make your list folder supported so that you can organize your list in folders.
Note: If the Title field is removed from the base List, the Folder is not supported for the list.
-
Click Save and Continue.
-
Select EmployeeDetails table from the list and then click Next. The List Designer page appears.
Note: All the fields that you have created in your database are displayed in the list. The parent items like Title, EmployeeName and EmployeeNo are displayed in the list.
-
Click Submit.
-
A form with the same name as that of the list is auto-generated when you submit the list. Select Yes if you want to regenerate the form, else select No. You can also edit the form using the Edit option from the Forms page.
This list data is not version enabled. Let us see how non-versioned data is managed in a list.
-
In the Enterprise Console, click the Menu button, click Tools, and then click Manage List. The Manage List page appears.
-
Click Employee Details. The Employee Details items list is displayed.
-
Click New on the Ribbon bar to create a new list item for the Employee Details list.
-
Type the list item details as follows.
Field
Data
Title
Mr
EmployeeName
Alex
EmployeeNo
A00012
-
Click Submit. The list item is saved.
-
Select the list item and right click the mouse. Since the Employee Details list does not have a child list, it is not version enabled. So you cannot see the Save As context menu in the right click options.
Next, add one child table Address to the Employee Details list to make this list version enabled.
To add an Address list
-
In the Enterprise Console, click the Menu button, click Tools, and then click Manage List. The Manage List page appears.
-
Select the Employee Details list and click Edit on the Ribbon bar. The Create List window is displayed.
-
You can edit the Description and Folder Supported option. The Title field will be disabled for editing. Click Save & Continue. The Forms Designer page is displayed with the Employee Details list.
-
Drag and drop the List table in to the orange bar of the list name area.
-
Select the Address table from the list and then click Select. The Form Property window is displayed.
-
Enter the Tag name as Address.List Table
-
Click Save.
-
Now, a child list table is also added to the Employee Details list and this data will be versioned.
-
Click Submit. The Re-Generate Form dialog box appears.
-
A form with the same name as that of the list is auto-generated when you submit the list. Select Yes, regenerate the default form and click OK if you want to regenerate the form, else select No, do not regenerate the default form option and click OK. Select Yes and regenerate the default form with the new fields (Current Address and Permanent Address).
-
Remove the Title Field from the Address child form. See Also Deleting a Control.
-
Next, disable the repeating property of the Address since a person will have only one current address and permanent address. For that, click the Properties button for the Address control. The Address Properties window is displayed.
-
Delete the Mapped XML Node.
-
Select False from the Is repeating drop-down list.
-
Click Save.
-
Click Submit.
Now, you can create list items for this and save it as a different version. To verify this:
-
In the Enterprise Console, click the Menu button, click Tools, and then click Manage List. The Manage List page appears.
-
Click Employee Details. The Employee Details items page is displayed.
-
Click New on the Ribbon bar to create a new list item for the Employee Details list.
-
Type the list item details.
Field
Data
Title
Mr
EmployeeName
John
EmployeeNo
J012
CurrentAddress
21, HSR Layout, Bangalore
PermanentAddress
2nd Cross Rd, Powai, Mumbai
-
Click Submit. The list item is saved.
-
Then select the list item and right-click it to open the context menu. Since the Employee Details list is version enabled, you can see the Save As context menu in the right-click options. This menu will help you to create different versions for the list item.
To save an item as next major version:
-
In the Enterprise Console, click the Menu button, click Tools, and then click Manage List. The Manage List page appears.
-
Select Lists and click Employee Details.
Note: Our objective is to create a next major version for the item.
-
Right click the required item list.
-
Click Next Major Version. The Save List Item dialog box appears. You can specify your comments in the text box provided. Let us leave the field blank as it is not a mandatory field.
-
Click Save New Version. An information message appears.
-
Click OK. An information message appears.
-
Click OK.
-
Right-click the same item list and select Show All Versions.
Note: In the same way, you can create Next Minor Version, Specific Version and Next version of the list item. If you make any changes in the main list i.e. Employee Details, this will reflect in all the versions. If you make changes in the Address items, that will not affect any other items or other versions.
To enable version for a child table with multiple records
Next you will see how a child table with multiple records can be version enabled. For this purpose, add one repeating child item Qualification to the existing list.
The Qualification table has the following schema:
-
Title
-
University
-
Year of Pass
Before starting with this scenario, create a table Qualification in your database.
To create a Qualification table
-
Login to your SQL Server.
-
Copy the following script to your server and execute it.
CREATE TABLE [dbo].[Qualification](
[Id] [uniqueidentifier] NOT NULL CONSTRAINT [DF__Qualification__Id__1E6F845E] DEFAULT (newid()),
[Title] [nvarchar](250) NOT NULL,
[Application] [nvarchar](150) NULL,
[CreatedBy] [uniqueidentifier] NULL,
[CreatedDateTime] [datetime] NULL,
[LastUpdatedDateTime] [datetime] NOT NULL,
[WIP] [bit] NULL,
[WIPItemId] [uniqueidentifier] NULL,
[MainItemId] [uniqueidentifier] NULL,
[ParentItemId] [uniqueidentifier] NULL,
[RecordParentItemId] [uniqueidentifier] NULL,
[TableId] [uniqueidentifier] NULL,
[ItemRowIndex] [int] NULL,
[IsLatest] [bit] NULL,
[Version] [nvarchar](25) NULL,
[VersionHistory] [nvarchar](max) NULL,
[Status] [int] NULL,
[LockedBy] [uniqueidentifier] NULL,
[LockedOn] [datetime] NULL,
[ListID] [uniqueidentifier] NULL,
[SecuritySettings] [nvarchar](max) NULL,
[ItemId] [uniqueidentifier] NULL,
[ItemType] [int] NULL,
[SecurityItemId] [uniqueidentifier] NULL,
[Owner] [uniqueidentifier] NULL,
[ModifiedBy] [uniqueidentifier] NULL,
[AuditTrail] [nvarchar](max) NULL CONSTRAINT [DF_Qualification_AuditTrail] DEFAULT (''),
[IsDisabled] [bit] NULL CONSTRAINT [DF_Qualification_IsDisabled] DEFAULT ((0)),
[WorkflowStatus] [varchar](50) NULL,
[SecurityCustomizationId] [uniqueidentifier] NULL,
[University] [nvarchar](50) NULL,
[YearofPass] [int] NULL,
CONSTRAINT [PK_Qualification] PRIMARY KEY NONCLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
To add a Qualification child table to the Employee Details list
-
In the Enterprise Console, click the Menu button, click Tools, and then click Manage List. The Manage List page appears.
-
Select the Employee Details list and click Edit on the Ribbon bar. The Create List window is displayed.
-
You can edit the Description and Folder Supported options. The Title field will be disabled for editing. Click Save & Continue. The Forms Designer page is displayed with the Employee Details list.
-
Drag and drop the List Table in to the orange bar of the list name area.
-
Select the Qualification table from the list and then click Select. The List TableForm Property window is displayed.
-
Enter the Tag name as Qualification.
-
Click Save. The List Designer page appears. Now, a child list table is also added to the Employee Details list and this data will be versioned.
-
Click Submit. The Re-Generate Form dialog box appears.
-
A form with the same name as that of the list is auto-generated when you submit the list. Select Yes, regenerate the default form and click OK if you want to regenerate the form, else select No, do not regenerate the default form option and click OK. On regenerating the form, all the changes made to the form will be lost. So it is recommended that you do not select this option. You can also edit the form using the Edit option from the Forms page.
To edit the list form
-
In the Enterprise Console, click the Menu button, and then click Forms. The Forms page appears.
-
Select the Employee Details form and click Edit on the Ribbon Bar.
-
Replace the Qualification Form with the Grid control.
-
Click Save.
-
Click Submit.
Now, you can create list items for this and save it as a different version. In this scenario, you will add multiple records in the Qualification grid and save it as different version. To verify this:
-
In the Enterprise Console, click the Menu button, click Tools, and then click Manage List. The Manage List page appears.
-
Click Employee Details. The Employee Details items page is displayed.
-
Click New on the Ribbon bar to create a new list item for the Employee Details list.
-
Type the list item details.
Field
Data
Title
Mr
EmployeeName
Alex
EmployeeNo
A00352
CurrentAddress
21, BTM Layout, Bangalore
PermanentAddress
706, Oxford, 21, Thane
Qualification 1
Title
MCA
University
University of Bangalore
YearofPass
2002
Qualification 2
Title
ME
University
University of Mumbai
YearofPass
2005
-
Click Submit. The list item is saved.
-
Select the list item and right-click the mouse. Since the Employee Details list is version enabled, you can see the Save As context menu in the right-click options. This menu will help you to create different versions for the list item.
-
Our objective is to create a next version for the item.
-
Click Next Version. The Save List Item dialog box appears. You can specify your comments in the text box provided. Let us leave the field blank as it is not a mandatory field.
-
Click Save New Version. An information message appears.
-
Click OK. An information message appears.
-
Click OK.
-
Right-click the same item list and select Show All Versions.
Note: In the same way, you can create Next Minor Version, Specific Version and Next version of the list item. If you make any changes in the main list i.e. Employee Details, this will reflect in all the versions. If you make changes in the Address items, that will not affect any other items or versions.