Showing results for 
Search instead for 
Did you mean: 

How to add more than 1 child table to UDO

Former Member
0 Kudos

Hi Experts,

Can u tell me how to add more than 1 child tables to an UDO.I am adding as shown below code,but the child table "Y1" only is add but i am unable to add "X1".I want to add "X1" also.Pleas help me regarding this.

Dim oUserObjectMD As SAPbobsCOM.UserObjectsMD
            oUserObjectMD = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserObjectsMD)
            oUserObjectMD.CanCancel = SAPbobsCOM.BoYesNoEnum.tYES
            oUserObjectMD.CanClose = SAPbobsCOM.BoYesNoEnum.tYES
            oUserObjectMD.CanCreateDefaultForm = SAPbobsCOM.BoYesNoEnum.tNO
            oUserObjectMD.CanDelete = SAPbobsCOM.BoYesNoEnum.tYES
            oUserObjectMD.CanFind = SAPbobsCOM.BoYesNoEnum.tYES
            oUserObjectMD.CanYearTransfer = SAPbobsCOM.BoYesNoEnum.tYES
            oUserObjectMD.ChildTables.TableName = "X1"
            oUserObjectMD.ChildTables.TableName = "Y1"
            oUserObjectMD.Code = "XYZ"
            oUserObjectMD.ManageSeries = SAPbobsCOM.BoYesNoEnum.tYES
            oUserObjectMD.Name = "XYZ"
            oUserObjectMD.ObjectType = SAPbobsCOM.BoUDOObjType.boud_Document
            oUserObjectMD.TableName = "XY"
            lRetCode = oUserObjectMD.Add()



View Entire Topic
Former Member
0 Kudos

Hi Rajesh,

Welcome you to the forum.

You should not define like this:

oUserObjectMD.ChildTables.TableName = "X1"

oUserObjectMD.ChildTables.TableName = "Y1"

The 2nd statement will override the first one. You need put the 2nd after the first child table created with detail.