I'm developing a java application to create & update sales orders in B1. I had planned on using user-defined fields to store cross-reference informatin when the sales order is created. This would allow me to process future updates. However, when I reviewed the DI API help, I discovered that user-defined fields are read-only. Is there a way to provide a value for a user-defined field when a business object (i.e. sales order) is created?
TIA
Russell
The DI API help file Version 6.5 that I have states
"All of the properties, except ValidValue and Value, are read only."
Value is the property you need to use. Using VB6.0 I can easily update user-defined fields on business objects when creating them. I haven't tried it in Java, but I would expect it to work the same.
eg.
Dim sboItem As SAPbobsCOM.Items
Set sboItem = sboCompany.GetBusinessObject(oItems)
sboItem.ItemCode = "XXXX"
sboItem.ItemName = "Description"
sboItem.UserFields.Fields("U_HCode").Value = "H1"
If (0 <> sboItem.Add()) Then
MsgBox ("Failed to add item.")
Else
MsgBox ("Success - item added..")
End If
John.
Add a comment