How to update a line number column in a capture table at process level
Article # 3036097 - Page views: 88
Issue
The line number values are not extracted from the document so have to be added programmatically. The following steps will enable you to update a line number column in a capture table at process level.
Solution
Please find below the sample .NET code calling the UpdateDocumentFieldValues() SDK to update a line number column at the process level:
public void MyUpdateDocumentFieldValueSample(string sessionId, string docId) { var cds = new sdk.CaptureDocumentService(); RuntimeFieldCollection rfc = new RuntimeFieldCollection(); TableFieldIdentity tfi = new TableFieldIdentity(); tfi.Name = "LineItems"; DataSet ds = cds.GetDocumentTableFieldValue(sessionId, null, docId, tfi); DataTable dt = ds.Tables[0]; int lines = 0; for (int i = 0; i < dt.Rows.Count; i++) { lines++; rfc.Add(new RuntimeField() { Name = "LineItems", TableColumn = 5, TableRow = i, Value = lines.ToString() }); } cds.UpdateDocumentFieldValues(sessionId, null, docId, rfc); }
- A new column (position 5) will inserted into the Capture Starter Pack Northwest document class. (TableColumn can be changed as desired)
- Add a .NET node calling the above method to the Capture Starter Pack process after Validation.
- Add a loop node to call the method for each document in the folder.
- When the job completes, the lineItem LineNum column will be updated successfully.
Level of Complexity
Moderate
Applies to
Product | Version | Build | Environment | Hardware |
---|---|---|---|---|
KofaxTotalAgility | All |