hi.
you have to use get by key method for updating the user defined fields..like below..
sales order i am upating.
Dim vOrder As SAPbobsCOM.Documents
vOrder = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders)
Dim s As String
If vOrder.GetByKey(150) Then
'here 150 is the doc entry i am going to update the fields.
Header:
oDocument.UserFields.Fields.Item("U_XYZ").Value = "Test";
Line:
oDocument.Lines.UserFields.Fields.Item("U_XYZ").Value = "Test;
Somet times you have to convert it to string.
myVar = oDocument.UserFields.Fields.Item("U_XYZ").Value.ToString();
MessageBox.Show(s)
End If