Skip to Content
0
Former Member
Oct 17, 2008 at 07:31 PM

Register UDO

50 Views

Hello to all. I am trying to register an UDO, need that sera a form for fault, and when I put the option, it me does not recognize. Here this one the code. If someone knows since solving it I will be grateful for it to him.

Private Shared Sub BPAR10(ByVal oCompany As SAPbobsCOM.Company)

Dim oUserObjectMD As SAPbobsCOM.UserObjectsMD

oUserObjectMD = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserObjectsMD)

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

oUserObjectMD.CanCancel = SAPbobsCOM.BoYesNoEnum.tYES

oUserObjectMD.CanClose = SAPbobsCOM.BoYesNoEnum.tYES

oUserObjectMD.CanCreateDefaultForm = SAPbobsCOM.BoYesNoEnum.tYES

oUserObjectMD.FormColumns.

oUserObjectMD.CanDelete = SAPbobsCOM.BoYesNoEnum.tYES

oUserObjectMD.CanFind = SAPbobsCOM.BoYesNoEnum.tYES

oUserObjectMD.CanLog = SAPbobsCOM.BoYesNoEnum.tNO

oUserObjectMD.CanYearTransfer = SAPbobsCOM.BoYesNoEnum.tYES

'Columnas que debe traer la grilla

oUserObjectMD.FindColumns.ColumnAlias = "DocEntry"

oUserObjectMD.FindColumns.Add()

oUserObjectMD.FindColumns.SetCurrentLine(1)

oUserObjectMD.FindColumns.ColumnAlias = "DocNum"

oUserObjectMD.FindColumns.Add()

oUserObjectMD.FindColumns.SetCurrentLine(2)

oUserObjectMD.FindColumns.ColumnAlias = "U_TGV_FVATWD_CARDCOD"

oUserObjectMD.FindColumns.Add()

oUserObjectMD.FindColumns.SetCurrentLine(3)

oUserObjectMD.FindColumns.ColumnAlias = "U_TGV_FVATWD_DATE"

oUserObjectMD.FindColumns.Add()

oUserObjectMD.FindColumns.SetCurrentLine(4)

oUserObjectMD.FindColumns.ColumnAlias = "U_TGV_FVATWD_RET_TYP"

oUserObjectMD.FindColumns.Add()

oUserObjectMD.FindColumns.SetCurrentLine(5)

oUserObjectMD.FindColumns.ColumnAlias = "U_TGV_FVATWD_PAYORD"

oUserObjectMD.FindColumns.Add()

oUserObjectMD.LogTableName = ""

'Nombre de la tabla hija si es que tiene

oUserObjectMD.ChildTables.TableName = "TGV_TVATWD_DOCHIS"

oUserObjectMD.UseUniqueFormType = SAPbobsCOM.BoYesNoEnum.tYES

oUserObjectMD.ExtensionName = ""

oUserObjectMD.ManageSeries = SAPbobsCOM.BoYesNoEnum.tYES

oUserObjectMD.Code = "BPAR10"

oUserObjectMD.Name = "Certificados de Retención (IVA)"

oUserObjectMD.ObjectType = SAPbobsCOM.BoUDOObjType.boud_Document

oUserObjectMD.TableName = "TGV_TVATWD_DOCS"

If oUserObjectMD.Add() <> 0 Then

Dim ErrMsg As String

Dim ErrCode As Long

oCompany.GetLastError(ErrCode, ErrMsg)

MsgBox("Error Registrando UDO BPAR10" & vbCrLf & ErrMsg)

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

oUserObjectMD = Nothing

End If

Else

MsgBox("El UDO BPAR10 ya existe.")

End If

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

End Sub

Edited by: Andres Blanco on Oct 17, 2008 9:32 PM