Hello,
I'm trying to create with UserObjectsMD, but the method failes with the message [OUDO.TableName], 'tablename'
the name my usertable is TCONDUC. I have try asign : TCONDUC, @TCONDUC and [@TCONDU] , but the method failes.
the code is :
oUDO = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserObjectsMD)
oUDO.Code = "CodeUDO"
oUDO.Name = "Prueba"
oUDO.TableName = "TCONDUC"
oUDO.ObjectType = SAPbobsCOM.BoUDOObjType.boud_MasterData
oUDO.ManageSeries = SAPbobsCOM.BoYesNoEnum.tYES
oUDO.CanCancel = SAPbobsCOM.BoYesNoEnum.tYES
oUDO.CanClose = SAPbobsCOM.BoYesNoEnum.tYES
oUDO.CanDelete = SAPbobsCOM.BoYesNoEnum.tYES
oUDO.CanLog = SAPbobsCOM.BoYesNoEnum.tYES
oUDO.CanCreateDefaultForm = SAPbobsCOM.BoYesNoEnum.tYES
With oUDO.FormColumns
.FormColumnAlias = "Code"
.FormColumnDescription = "Codigo"
.Add()
.FormColumnAlias = "Name"
.FormColumnDescription = "DEscripcion"
.Add()
.FormColumnAlias = "U_Telefono"
.FormColumnDescription = "Telefono"
.Add()
End With
'Creacion del Objeto
lRetCode = oUDO.Add() -> here Failed
If lRetCode <> 0 Then
oCompany.GetLastError(lRetCode, sErrMsg)
MessageBox.Show(sErrMsg, "Error")
Exit Sub
End If
Jose Antonio.
The correct syntax for the table name is "@TCONDUC".
Is the table you have created (TCONDUC) of type MasterData?
To verify everything about your table you can try to use the UDO Wizard to create a UDO with your table. If your table doesn't appear as possible tables to create a UDO of type MasterData then the problem comes from your table type.
Saludos
Trinidad.
Add a comment