How to update UserField?
I am working on a grid, and am using VB.NET.
The picture below shows what I want to achieve.
I found an answer here:
And here is my code, which is an adaptation of the above thread:
'// If TYPE = GRPO
If oOPDN.GetByKey(oDocEntry) Then
oOPDN.UserFields.Fields.Item("U_HandOver").Value = "Y"
oOPDN.UserFields.Fields.Item("Seq").Value = oValue <--- How to dim oValue?
retVal = oOPDN.Update
The Update works for "U_HandOver", but not for "Seq" because I have not dim "oValue"
How to declare oValue?
Ankit Chauhan replied
Try it as follows:
For i As Integer = 0 To oGrid.Rows.Count - 1
Dim oValue As String = Convert.ToString(oGrid.DataTable.GetValue("Seq", i))
-- Dim ItemCode As String = Convert.ToString(oGrid.DataTable.GetValue("Item Code", i))
Hope it helps now.
Thanks & Regards