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

UDO update not automatic?

Hi All,

I have a form with a UDO linked to it. The add, find and browse part works fine. When I change something on an existing record and press the update key, it does not save it. It works if I change something in the header, but not if I change a value in the matrix. I looked at the MasterDataUDO example, but can still not figure out what the problem is.

Any help appreciated,

Adele.

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    Posted on Sep 21, 2005 at 10:42 AM

    The table linked to the matrix... are they created as UDO-lines... it should be... else you have to update it yourself...

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Everybody,

      I eventually solved this problem. Thanks to all of you who tried to assist. The problem is that the UDO name MUST be uppercase. I defined a constant for the name as

        Private MYUDO As String = "MyUDO"

      Everything works 100% except the update part.It also works fine on patches before version 15. Currently testing on PL05.

      It only took me about 3 weeks to eventually figure it out 😊 Imagine my frustration. I solved it by running a SQL trace when adding through DI and also when running in SBO itself. I then saved the traces to files and compared the 2 versions...

      Thanks for your help guys,

      Adele

  • author's profile photo Former Member
    Former Member
    Posted on Sep 21, 2005 at 10:37 AM

    I think this is right. I suppose that you have to "save" your data twice. It probably works like the documents numbering form. Check it out hope it helps

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 27, 2005 at 05:19 AM

    hi.

    It is auto in PL:15 version. not in less. In less version, you must catch the default button event and handle the query manually.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi All,

      I have figured out that if I register the UDO manually (in SBO) it works perfectly. If not, my update does not work (everything else works). Herewith my code for creating UDO. Can anyone tell me where the problem is? The registration in SBO looks the same of both (manual and auto).

      Thanks,

      Adele

              Dim oUserObjectMD As SAPbobsCOM.UserObjectsMD
              oUserObjectMD = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserObjectsMD)
              If oUserObjectMD.GetByKey("My_UDO") = 0 Then
                  oUserObjectMD.Code = "My_UDO"
                  oUserObjectMD.Name = "My_UDO"
                  oUserObjectMD.ObjectType = SAPbobsCOM.BoUDOObjType.boud_MasterData
                  oUserObjectMD.TableName = TForm
                  oUserObjectMD.CanCancel = SAPbobsCOM.BoYesNoEnum.tYES
                  oUserObjectMD.CanDelete = SAPbobsCOM.BoYesNoEnum.tYES
                  oUserObjectMD.CanFind = SAPbobsCOM.BoYesNoEnum.tYES
                  oUserObjectMD.FindColumns.ColumnAlias = "Code"
                  oUserObjectMD.FindColumns.Add()
                  oUserObjectMD.FindColumns.SetCurrentLine(1)
                  oUserObjectMD.FindColumns.ColumnAlias = "Name"
                  oUserObjectMD.ChildTables.TableName = TItem
                  If oUserObjectMD.Add() <> 0 Then
                      Dim ErrMsg As String
                      Dim ErrCode As Long
                      oCompany.GetLastError(ErrCode, ErrMsg)
                      MessageBox.Show("Error: " & ErrMsg)
                      System.Runtime.InteropServices.Marshal.ReleaseComObject(oUserObjectMD)
                      oUserObjectMD = Nothing
                  End If
              End If
              System.Runtime.InteropServices.Marshal.ReleaseComObject(oUserObjectMD)
              oUserObjectMD = Nothing

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.