Edit Existing Folder Item in Workflow List
- Last UpdatedJun 10, 2024
- 1 minute read
The following code sample demonstrates how to edit the existing folder details available in the Workflow list.
PROCEDURE
Dll REFERENCE
Workflow.NET.NET2
Skelta.forms.core
NAMESPACE USED
Workflow.NET
Skelta.Forms.Core.Controls
Skelta.Repository.List
Skelta.Entity
Try the following code in a console application by adding the above references and name spaces:
//Creating ListDefinition for specified Repository and List
//Here Application="Telematics Repo" and List="Workflow"
ListDefinition listdef = ListDefinition.GetList(new Skelta.Core.ApplicationObject("Telematics Repo"), "Workflow");
//Creating the User Context
UserContext UserCtx = new UserContext(new Guid("38D26E38-9AA2-4DBF-A6BD-5C45F9FA953E"),new
Skelta.Core.ApplicationObject("Telematics Repo"),"skeltalist") ;
Skelta.Repository.List.ListItemCollection newListItemCollection = new
Skelta.Repository.List.ListItemCollection(listdef);
DataTable dtAllRecords = new DataTable();
//Test is the folder name
dtAllRecords = newListItemCollection.GetRecords("Title", "Test",UserCtx.LoggedInUserId);
Guid folderGuid = new Guid(dtAllRecords.Rows[0]["Id"].ToString());
Skelta.Repository.List.ListItem newListItem = new Skelta.Repository.List.ListItem(listdef,
folderGuid);
//Assigning the Title and description for the listitem
((ListTextDataItem)newListItem.ListForm.Records[0].FindControlByID("_sys_wf_title")).Value
= "Testing";
((ListTextDataItem)newListItem.ListForm.Records[0].FindControlByID("_sys_wf_desc")).Value
="Description text";
//Saving the information in the database.
newListItem.Save();