Skip to Content
avatar image
Former Member

Business objects (UDO)

Is there a way to get my business object (a UDO) back in the same manner as a B1 GetBusinessObject()? This way I could update the fields as needed.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • avatar image
    Former Member
    Jul 20, 2006 at 06:31 AM

    Hello Gary,

    Sorry to tell you that updating UDO is not supported by DI API now.

    Sorry,

    Nick

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Is it even possible to read it without a form? ..or do I have to resort to the hack of creating a form and making it invisible?

      Hardly much of an "Data Object" then...

  • Jul 21, 2006 at 07:45 AM

    You can read the tables of your UDOs with SQL, this is

    allowed by SDK development guidelines.

    You cannot add / update / delete UDOs out of B1, sorry.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 23, 2010 at 10:51 AM

    I'm on 2007 version...

    If i'm not wrong i think you can use this code to access data from your tables..

    Dim oUserTable as SAPbobsCOM.UserTable
    oUserTable = oCompany.UserTables.Item("Res")   '-- Res is your User Defined Table name
    oUserTable.Code = "123"               ' -- Default fields SAP provides can be accessed directly
    oUserTable.Name = "Test"
    oUserTable.UserFields.Fields.Item("U_LS").Value = "Test Data"    '-- To access User Defined Fields.
    oUserTable.UserFields.Fields.Item("U_Rb").Value = "Data2"
    
    oUserTable.Add()

    I think this code's suppose to work. But you can use it only after maiking the UDO.

    Correct me if i'm wrong. I'm still new to B1

    Thanks.

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 25, 2010 at 11:09 AM

    Hi,

    You can use General Services to Add/Update/Select from your UDO's.

    There are examples in the SDK Help.

    You can read further [here|automatic-insert-in-user-defined-form-of-type-tran].

    Best regards.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 25, 2010 at 11:10 AM

    I haven't used this feature myself. But in version 8.8 you have a DI API object called GeneralService that will allow you add and update UDOs.

    But this feature is only available in SAP 8.8

    Add comment
    10|10000 characters needed characters exceeded

    • Actually this feature first became available in SAP Business One 2007A PL46. You can see the blog on this on SDN at ...

      /people/daniel.wroblewski/blog/2009/03/26/udo-access-via-di-api-in-pl46

      So it is available for Business One 8.8 and 2007A as of PL46.

      Eddy