Skip to Content
author's profile photo Former Member
Former Member

DI: updating user-defined fields

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Feb 05, 2004 at 04:48 PM

    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
    10|10000 characters needed characters exceeded

    • Former Member

      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

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.