Skip to Content
0
Former Member
Jun 08, 2009 at 12:10 PM

Reading a UDF from Document_Lines

40 Views

Hello everyone!

I'm trying to read some UDF's from a line from a document lines, like that:

SAPbobsCOM.Documents oDoc;
SAPbobsCOM.Document_Lines oLines;
string value = null;

oDoc = ((SAPbobsCOM.Documents)(oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders)));
oDoc.GetByKey(AbsEntry);
oLines = oDoc.Lines;
for (int i = 1; i <= oLines.UserFields.Fields.Count; i++)
     {
         oLines.SetCurrentLine(0); // for now i want only the first line
         value = oLines.UserFields.Fields.Item(i-1).ValidValue;
      }

For some reason, i never get a valid value, just null (also when the field is filled with something). i tried also to pull it into Field object and read the validvalue from there, but i got the same resault.

When i try to pull the field name, i get a value.

Am i doing something wrong?

Thanks&Regards

Moshe