Skip to Content
0
Former Member
Jun 14, 2005 at 11:01 AM

UDO WITH MORE THAN ONE CHILD TABLE

17 Views

Hello There.

Can I handle more than one child table for a master table by code?

if I can, how do I create this udo, I have tryed the following code, but it takes the last child table ("jobs7")

If oUserObjectMD.GetByKey("Jbs_UO") = 0 Then

oUserObjectMD.CanCancel = SAPbobsCOM.BoYesNoEnum.tYES

oUserObjectMD.CanClose = SAPbobsCOM.BoYesNoEnum.tYES

oUserObjectMD.CanCreateDefaultForm = SAPbobsCOM.BoYesNoEnum.tNO

'oUserObjectMD.FormColumns

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.CanLog = SAPbobsCOM.BoYesNoEnum.tNO

oUserObjectMD.LogTableName = ""

oUserObjectMD.CanYearTransfer = SAPbobsCOM.BoYesNoEnum.tNO

oUserObjectMD.ChildTables.TableName = "JOBS1"

oUserObjectMD.ChildTables.TableName = "JOBS2"

oUserObjectMD.ChildTables.TableName = "JOBS3"

oUserObjectMD.ChildTables.TableName = "JOBS4"

oUserObjectMD.ChildTables.TableName = "JOBS5"

oUserObjectMD.ChildTables.TableName = "JOBS6"

oUserObjectMD.ChildTables.TableName = "JOBS7"

oUserObjectMD.ExtensionName = ""

oUserObjectMD.ManageSeries = SAPbobsCOM.BoYesNoEnum.tNO

oUserObjectMD.Code = "Jbs_UO"

oUserObjectMD.Name = "Jobs UDO"

oUserObjectMD.ObjectType = SAPbobsCOM.BoUDOObjType.boud_MasterData

oUserObjectMD.TableName = "JOBS"

If oUserObjectMD.Add() <> 0 Then

Dim ErrMsg As String

Dim ErrCode As Long

oCompany.GetLastError(ErrCode, ErrMsg)

MsgBox("Errorf adding UDO master Data" & vbCrLf & ErrMsg)

System.Runtime.InteropServices.Marshal.ReleaseComObject(oUserObjectMD)

oUserObjectMD = Nothing

Return False

End If

End If