on 02-04-2004 12:47 PM
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your reply. The VB example certainly looks easy and straightforward, but I don't think I can access the properties directly in Java. Because of the property definition in the object (Documents), I'm limited to using get & set methods. The UserFields property has a get method, but no set method. My workaround was to stick the legacy reference in an unused field. I'm still learning Java so there may be a trick that I'm not aware of.
Thanks again for your help.
Russell
User | Count |
---|---|
95 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.