Skip to Content

How to update UserField?

Hi,

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

                        ....

                       .....

My Question:

The Update works for "U_HandOver", but not for "Seq" because I have not dim "oValue"

How to declare oValue?

Thanks

Leon Lai

Capture.JPG (117.8 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Dec 26, 2014 at 12:15 PM

    Hi Leon,

    As you said you are using Grid, oValue should be oGrid.DataTable.GetValue("Seq", RowNumber).ToString()

    You can convert it the desired DataType. So it should be like this:

    for (int k = 0; k <= oGrid.Rows.Count - 1; k++)

    {

         string IsSelectedHandOver = oGrid.DataTable.GetValue("U_HandOver", k).ToString();

         string SEQ = oGrid.DataTable.GetValue("Seq", RowNumber).ToString();

         string Type = oGrid.DataTable.GetValue("TYPE", RowNumber).ToString();

         if (Type == "GRPO")

         {

                               If oOPDN.GetByKey(oDocEntry) Then

                                 oOPDN.UserFields.Fields.Item("U_HandOver").Value = "Y"

                                 oOPDN.UserFields.Fields.Item("Seq").Value = SEQ    <---  I am assuming SEQ is of Alphanumeric Type

                                 retVal = oOPDN.Update

         }

    }

    Hope it helps.

    Thanks & Regards

    Ankit Chauhan

    Add comment
    10|10000 characters needed characters exceeded