cancel
Showing results for 
Search instead for 
Did you mean: 

UDO update not automatic?

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

rasmuswulff_jensen
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Lines is MasterDataLines.

Form is connected to UDO.

MasterDataUDO example saves data automatically on update, mine not. Cannot see any difference

rasmuswulff_jensen
Active Contributor
0 Kudos

Is your UDO registrated with the lines?... Else i can see where the problem is

Former Member
0 Kudos

Yes, it is. I don't have any code on the OK/Add/Update button that changes the bubbleEvent either. This is happening on 2 of my windows. I have not done this successfully yet.

Former Member
0 Kudos

Hi Everybody,

I am still having this problem. Can anyone give me some insight? The steps that I followed now:

1. Create a UDO (add, update, find, delete and cancel set to true)

2. Master Data object with one table linked as lines

3. Code and Name selected for "Find"

4. Then I create a form with screen painter. I set databinding to tables that are part of the UDO.

5. I set the UDOType on the form.

Now when I open my form it all works 100%. Find, browse and add. After add if I change something in the header part (e.g. Code or Name) and click the update button, it is saved. If I change something in the matrix it is not saved (it looks like it, but when you browse back to the record, it does not get updated).

Your help is appreciated! This is driving me insain. Am I right by saying that the update should work automatically?

Thanks a lot!

Adele

Former Member
0 Kudos

Hi

When u add matrix to the form , make sure whether this property u have set or not....

oItem.AffectsFormMode = True

'specifying whether or not modifying the column affects the form mode, As user enter some value in Matrix, form mode gets converted to Update mode

Former Member
0 Kudos

Hi Pankaj,

Thanks for your reply, but if the problem was on the form why does my form work when I register the UDO manually in SBO. It only doesn't work if I register UDO throug VB.Net add-on application.

Thanks,

Adele

Former Member
0 Kudos

Hi Adele

Just check few points:

1. Check entry in UDO1 Whther there r entry for ur child table.

2. Have u add child table also

ex.

oUserObjectMD.ChildTables.TableName = UDOCHILD2

oUserObjectMD.ChildTables.Add()

3. Whther ur matrix colums r binded to fields correctly.

Former Member
0 Kudos

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

Answers (2)

Answers (2)

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

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