Skip to Content
0
Former Member
Mar 01, 2012 at 04:50 AM

Problem in Creating Default Form Through DI API

51 Views

Hi All,

I am using the below code to create UDO and make it as Default Form through DI API. But the Default Form property is not getting set, that is the Default Form is not being created. The UDO is getting created. Any help is appreciated.

// Verify that UDO is defined
            if (!(oCreateUDO.UDOExist(oCompany, "WEB_USER")))
            {
                SAPbobsCOM.UserObjectsMD MyUDO = (SAPbobsCOM.UserObjectsMD)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserObjectsMD);
                
                //Set Services
                MyUDO.CanCancel = SAPbobsCOM.BoYesNoEnum.tYES;
                MyUDO.CanCreateDefaultForm = SAPbobsCOM.BoYesNoEnum.tYES;
                MyUDO.CanDelete = SAPbobsCOM.BoYesNoEnum.tYES;
                MyUDO.CanFind = SAPbobsCOM.BoYesNoEnum.tYES;
                MyUDO.CanClose = SAPbobsCOM.BoYesNoEnum.tYES;
                MyUDO.CanLog = SAPbobsCOM.BoYesNoEnum.tYES;
                MyUDO.CanYearTransfer = SAPbobsCOM.BoYesNoEnum.tNO;
                //MyUDO.ManageSeries = SAPbobsCOM.BoYesNoEnum.tYES;
                
                MyUDO.Code = "WEB_USER";
                MyUDO.Name = "Define Portal User";
                MyUDO.ObjectType = SAPbobsCOM.BoUDOObjType.boud_MasterData;
                MyUDO.TableName = "PORUSR";

                MyUDO.FindColumns.ColumnAlias = "Code";
                MyUDO.FindColumns.ColumnDescription = "Code";
                MyUDO.FindColumns.Add();

                MyUDO.FindColumns.ColumnAlias = "Name";
                MyUDO.FindColumns.ColumnDescription = "Name";
                MyUDO.FindColumns.Add();

                MyUDO.FindColumns.ColumnAlias = "U_name";
                MyUDO.FindColumns.ColumnDescription = "Name";
                MyUDO.FindColumns.Add();

                MyUDO.FindColumns.ColumnAlias = "U_Email";
                MyUDO.FindColumns.ColumnDescription = "Email";
                MyUDO.FindColumns.Add();

                MyUDO.FindColumns.ColumnAlias = "U_Status";
                MyUDO.FindColumns.ColumnDescription = "Status";
                MyUDO.FindColumns.Add();

                MyUDO.FindColumns.ColumnAlias = "U_TAG";
                MyUDO.FindColumns.ColumnDescription = "TAG";
                MyUDO.FindColumns.Add();

                MyUDO.FindColumns.ColumnAlias = "U_bp";
                MyUDO.FindColumns.ColumnDescription = "BP Code";
                MyUDO.FindColumns.Add();

                MyUDO.FindColumns.ColumnAlias = "U_password";
                MyUDO.FindColumns.ColumnDescription = "Password";
                MyUDO.FindColumns.Add();

              

                if (MyUDO.Add() != 0)
                {
                    MessageBox.Show("Failed to add UDO");
                }
            }

Thanks and Regards,

Noor Hussain