UDO - DLL (1)

Hi,
I am using the User Defined Object (UDO) Wizard in B1. I am doing the UDO sample in SDK Help (Step 2 - Create a DLL for SM_MOR Object).
1) How do I build a C++ DLL (White Paper)?
2) And does it have to be a C++ DLL?
3) What about a C# DLL?
Thank you,
Rune

Hello,
I am going to write something about the UDO DLL development. Actually you can refer to the SDK sample <<Program Files\SAP\SAP Business One SDK\Samples\UDO\MealOrder\DllImplement>>. Or just copy to include in you own project and modify accordingly. Of course It is difficult to develop a UDO in C++ with only some C++ header files and B1UdoApi.lib without comments and instructions.  
1.Some important tips:
1).Don't forget to set Extenstion Path in Gernal Settings=>Path the before registration of UDO dll
2).Implement your UDO class inherites from CSboBusinessObject defined in SboBusinessObject.h
3).Export the dll entry point CreateObject with YourUdo.Def
EXPORTS
     CreateObject                 @1
in your UDO class, change the implementation of CreateObject
CSboBusinessObject *CreateObject (unsigned long systemHandle)
     return new CAbsenceReport (systemHandle); // change into your own UDO class
4).Override the virtual funcitons of CSboBusinessObject accordingly in your own UDO class. Very virtual function already has its default implementation in CSboBusinessObject. Don't forget to call CSboBusinessObject's default implementation after your code. For example:
call CSboBusinessObject::OnAdd() in after your code in yourUdo's OnAdd().
2.Include files: (More detailed description about the include files provided by SAP)
1).SboBusinessObject.h:  
You must implement your UDO class inheriting from CSboBusinessObject. UDO and B1 Business Object inheritING from the same base class (CSboBusinessObjectBase), which has implement the default operations(OnAdd(), OnUpdate(), OnIsValid()...). Thus UDO and B1 Business Object share the same routine of initialization and business process. You can override the virtual functions (OnAdd(), OnUpdate(), OnIsValid()...) accordingly. UDO works as plug-in of B1, loaded dynamically into B1's process. The virtual functions list as below
virtual SBOErr OnAutoComplete ();
virtual SBOErr OnCancel ();
virtual SBOErr OnCanDelete ();
virtual SBOErr OnClose ();
virtual SBOErr OnAdd ();
virtual SBOErr OnCreateDefaults ();
virtual SBOErr OnDelete ();
virtual SBOErr OnInitData ();
virtual SBOErr OnIsValid ();
virtual SBOErr OnGetByKey ();
virtual SBOErr OnUndoCancel ();
virtual SBOErr OnUpdate ();
virtual SBOErr OnUpgrade (long fromVersion, long toVersion);
virtual SBOErr AddYearTransferCondition(const CSboCondition &scConditionToAdd);
virtual SBOErr ClearAllYearTransferConditions();
virtual SBOErr OnYearTransfer (unsigned long companyRef);
There are some usful public functions that can be use in your UDO class directly.
//Get the value by collumn alias, table and row line
SBOErr GetValue (const wchar_t *alias, wchar_t *value, long maxLen = -1, ArrayOffset ao = ao_Main, long line = 0);
SBOErr GetValue (long colIndex, wchar_t *value, long maxLen = -1, ArrayOffset ao = ao_Main, long line = 0);
//Get the value by collumn alias, table (no table name but the table enum) and row line
long GetValueLength (const wchar_t *alias, ArrayOffset ao = ao_Main, long line = 0);
long GetValueLength (long colIndex, ArrayOffset ao = ao_Main, long line = 0);
//set the value into DB by collumn alias, table(no table name but the table enum) and row line
SBOErr SetValue (const wchar_t *alias, const wchar_t *value, ArrayOffset ao = ao_Main, long line = 0);
SBOErr SetValue (long colIndex, const wchar_t *value, ArrayOffset ao = ao_Main, long line = 0);
//Set the error field when return an error code. It will be display as error memessage in the status bar if return err code define in SBOErr.h.
SBOErr SetErrorField (const wchar_t *alias);
SBOErr SetErrorField (long colIndex);
//Display the message on B1 status bar
void Message (const wchar_t *str, WarningLevel type);
2).SboDataAcessGate.h and SboCondition.h
CSboDataAccessGate (dag) is the data acess layer connecting the UDO and Database. A dag is binidng with a Table. It is not accessed via the table name but some enum(aoMain: Main table, such as OCRD; ) .CSboCondition play as a role of creation of filter when access to a table in dag, similar to where clause in SQL query. It looks also like Conditions in UI API.
Example 1: UDO implementation using CSboDataAccessGate and CSboCondition
// BNBPDV.cpp : Defines the entry point for the DLL application.
#include "stdafx.h";
#include "SboBusinessObject.h";
#include "__SBOERR.h";
BOOL APIENTRY DllMain( HANDLE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
    return TRUE;
class BNBPDV : public CSboBusinessObject
public:
BNBPDV (unsigned long systemHandle):CSboBusinessObject(systemHandle),sysHandle(sysHandle)
~BNBPDV (){};
virtual CSboBusinessObject  *Clone (unsigned long systemHandle) {return new BNBPDV (systemHandle);}
virtual void Destroy () {delete this;}
virtual SBOErr OnAdd ()
SBOErr sboErr =noErr;
CSboDataAccessGate dagCurrent = GetDAG(ao_Main);
long key =0;
long codeCol = 0; //hardcode only once
long bpCol = 13;
wchar_t strKey[256] = {0};
//test code
//wchar_t* objName = L"BPDV";
//CSboDataAccessGate dagAllRec = GetDAG(objName, ao_Main);
//test code
//get all record
CSboDataAccessGate dagAllRec = dagCurrent.Clone( false );
CSboCondition cond;
cond.SetColAlias(L"Code");
cond.SetStaticCondVal(L"0");
cond.m_enumOperation = qot_GT;
sboErr = dagAllRec.AddCondition(cond);
if (sboErr != noErr) return sboErr;
sboErr = dagAllRec.DoQuery();
if (sboErr != noErr && sboErr != dbmNoDataFound) return sboErr;
long length = dagAllRec.GetRecordsCount();
//is the table empty
if( length ==1 && dagAllRec.GetValueLength(codeCol,0)==0 )
key =1;
else
long tmp = 0;
for( int i=0; i < length; i++ ) //we have to loop the table because there is no order by supported by UDO
wchar_t* stopStr=0;
sboErr = dagAllRec.GetValue(codeCol, strKey, -1, i);
if (sboErr != noErr) return sboErr;
tmp =  wcstol(strKey, &stopStr, 10);
if (tmp > key)
key = tmp;
key++;
//set the key
_ltow(key, strKey, 10);
sboErr = dagCurrent.SetValue(codeCol, strKey);
if (sboErr != noErr) return sboErr;
dagCurrent.SetValue(codeCol+1, strKey);
dagCurrent.SetValue(codeCol+2, strKey);
//to see if the bp is already existing
//get bp code
CSboDataAccessGate dagBP = dagCurrent.Clone( false );
wchar_t strBPCode[256] = {0};
sboErr = dagCurrent.GetValue(bpCol, strBPCode, -1, 0);
if (sboErr != noErr) return sboErr;
//query
CSboCondition condCheckBP;
condCheckBP.SetColAlias(L"U_BPCode");
condCheckBP.SetStaticCondVal( strBPCode );
condCheckBP.m_enumOperation = qot_EQ;
sboErr = dagBP.AddCondition(condCheckBP);
if (sboErr != noErr) return sboErr;
sboErr = dagBP.DoQuery();
if (sboErr != noErr && sboErr != dbmNoDataFound ) return sboErr;
length = dagBP.GetRecordsCount();
//there is already a existing bp
if( dagBP.GetValueLength(codeCol,0) != 0 )
//delete it
sboErr = dagBP.Delete(0);
if (sboErr != noErr) return sboErr;
else{} //every thing is fine
    //call father class OnAdd function
    sboErr = CSboBusinessObject::OnAdd ();
return sboErr;
private:
unsigned long sysHandle;
CSboBusinessObject *CreateObject (unsigned long systemHandle)
return new BNBPDV (systemHandle);
Example 2: Using CSboBusinessObject.Message() and SetErrorField()
#include "SboBusinessObject.h";
#include "OABR.h";
#include "SboCondition.h";
#include "__SBOERR.h";
#include "string"
#include <stdlib.h>;
#define MEAL_PRICE 25
CSboBusinessObject *CreateObject (unsigned long systemHandle)
return new CAbsenceReport (systemHandle);
CAbsenceReport::CAbsenceReport (unsigned long systemHandle) : CSboBusinessObject (systemHandle)
CAbsenceReport::~CAbsenceReport ()
void CAbsenceReport::Destroy()
delete this;
/* Virtual Functions */
SBOErr CAbsenceReport::OnAdd ()
    //Write your code here:  
    //call father class OnAdd function
    SBOErr sboErr = CSboBusinessObject::OnAdd ();
    return sboErr;
//Recommend to add
SBOErr CAbsenceReport::OnIsValid()
CSboDataAccessGate dagOABR = GetDAG (ao_Main);
CSboDataAccessGate dagClone = dagOABR.Clone( false );
TCHAR strIUser[11] = {0};
SBOErr sboErr = dagClone.GetValue(_T("U_iUser"), strIUser, -1, 0);
//this->Message(strIUser,wl_Note);
if (sboErr != noErr)
return sboErr;
if(0 == _tcslen(strIUser))
return -1;
TCHAR firstChar[1] = {strIUser[0]};
if(    0 != _tcscmp(_T("i"), firstChar)
&& 0 != _tcscmp(_T("I"), firstChar)
&& 0 != _tcscmp(_T("c"), firstChar)
&& 0 != _tcscmp(_T("C"), firstChar))
this->SetErrorArray(ao_Main);
this->SetErrorField(_T("U_iUser"));
//DisplayError(-1);
Message (_T("Invalid iUser. It must start with 'i' or 'I'."),  wl_Error);
return uiInvalidFieldValue;
return noErr;
Hope it helps. A more detail document will be followed up and back to you.
Kind Regards
-Yatsea

Similar Messages

  • Problem with meal order sdk sample (using c++ to define business logic)

    Hi there,
    I'm trying to use meal order udo sample from sdk but i cannot register .dll extension. it gives me Invalid dll path or name [User-Defined Object - Extension Name] error.
    What am i doing wrong?
    Thanks in advance

    Thanks but I was asking about something else. Maybe I wasn't precise.
    I'm trying to develop udo as extension written in c+. There is such a possibility. You can compile it into dll and then upon creating new object from sap b1 ui you link to that dll. Again this is written in c+ not c# or vb. But when I link that dll I get errror message that I posted in my previous message.
    Again I'm talking about this way to build udo objects -
    UDO - DLL (1)
    Thanks in advance

  • Create .DLL file to register an UDO

    Hi,
    How do we create a .DLL file to register an UDO? I would appreciate if you can give me a step by step minute details.
    Regards
    Sudatt

    Sudatt,
    The SAP Business One SDK Documentation covers the creation of a .dll to work with a UDO.  You can find the documentation at Customization Tools > User-Defined Objects > Creating a UDO > Step 4: Extending Business Logic.
    Eddy

  • UDO implementation DLL: Add base method

    Does anyone have any sample code on how to add data to object using the Add base method of the cSBOBusinessObject in C++?
    Message was edited by: Frank Moebius
    ...made the subject "a bit"  more specific...

    SBOErr  CLogisticsMasterDataObject::OnAdd ()
      /*e.g. call OnAdd of base class first (could do it later though...)*/
      SBOErr sboErr = CSboBusinessObject::OnAdd();
      if (sboErr != noErr)
        return sboErr;
      /* "FOM_UDO2" is the 2nd UDO here... - type Master Data*/
      CSboBusinessObject *pObject = CSboBusinessObject::CreateBusinessObject (_T("FOM_UDO2"));
      pObject->SetValue((_bstr_t)"Code", (_bstr_t)"4");
      pObject->SetValue((_bstr_t)"Name", (_bstr_t)"4");
      /* Add the new record for the 2nd UDO... */
      sboErr = pObject->Add(); 
      if (sboErr != noErr)
        return sboErr;
      /* "SM_BLK" is the 3rd UDO here... - type Document*/
      CSboBusinessObject *pObject = CSboBusinessObject::CreateBusinessObject (_T("SM_BLK"));
      /* no key required since generated automatically (remember that this is a Document!*/
      /* "Add()" would be just enough ;-) */
      /*//pObject->SetValue((_bstr_t)"U_BPCode", (_bstr_t)"C20000");*/
      /*//pObject->SetValue((_bstr_t)"U_BPName", (_bstr_t)"Customer with Blanket Agreement");*/
      /* Add the new record for the 3rd UDO...*/
      sboErr = pObject->Add();
      return sboErr;
    "error"
    As said in the reply before:
    "Please note that the entire OnAdd runs inside a global transaction (like you do it in DI API with StartTransaction/EndTransaction)..."
    Please take a look at the E-learning material:
    https://www.sdn.sap.com/irj/sdn/businessone-elearning
    This flashbook should answer your question - even though it is focussing on DI API...:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/d4f9bdf9-0901-0010-d798-ac79d485348e
    HTH
    Message was edited by: Frank Moebius

  • FMS in UDO

    Dear All,
    there are 2 UDOs created n been used without liking to any dll object, no sdk codings too be done.
    each Document type tables have 1 document row type table linked with it. i.e the child table been linked with the parent table.
    From the document table we are able to catch the unique form id. but from document row table its common to both child table.
    We encounter a problem when we define FMS to any field of the child table. if we define a conditioned FMS to a child table's field its getting assigned automatically to other child table too.
    How to differentiate it plz any one help!!!!

    Hai!
    Please Provide the procedure to test.
    1. Give ur FMS Code.
    2. Say the procedure, when FMS should fire.
    Regards,
    Thanga Raj.K

  • UDO - FMS

    Dear All,
    there are 2 UDOs created n been used without liking to any dll object, no sdk codings too be done.
    each Document type tables have 1 document row type table linked with it. i.e the child table been linked with the parent table.
    From the document table we are able to catch the unique form id. but from document row table its common to both child table.
    We encounter a problem when we define FMS to any field of the child table. if we define a conditioned FMS to a child table's field its getting assigned automatically to other child table too.
    How to differentiate it plz any one help!!!!

    Hai!
    Please Provide the procedure to test.
    1. Give ur FMS Code.
    2. Say the procedure, when FMS should fire.
    Regards,
    Thanga Raj.K

  • Choose From List used in UDO (B1 2004)

    Hi,
    in the presentation "Creating a UDO of document type.pps" (slide 53+55) provided with the SDK 2004 they use the Choose From List to select business partners and/or items in their UDO form when adding a new document. Does anyone know, how this has to be done? The sample, from the presentation is not provided in the sample codes.
    Do I have to use an implementation DLL for my UDO to use this functionality?
    My problem is, that it takes too long (about 5 times longer than with the system CFL) to get all items in my custom defined matrix.
    thanks,
    Markus

    Hi Markus,
    You cannot use the built-in CFL in version 2004. It is only exposed from version 2005. The only suggestion is to look at optimizing your matrix. All CFLs in the system uses DB Datasources which makes populating the grid faster than using User data sources.
    Hope it helps,
    Adele

  • List of Objects(UDO)

    Hello,
    I'm working in a project where I want to make a form for Route entry--
    eg-- Mumbai to Goa, Kolkata to Digha etc. like Business Partner Entry form.
    Then I need to have a list of routes in another form where a field for Route entry is, like BP list in Purchase Order form .
    Is it possible?
    How?
    Will I have to create a form for list of routes?
    Need any UDO?
    Rgds
    Subrata

    hello,
    It is possible. you can try to use UI/DI API if you want it like BP form or UDO like user table you just want to record it in a table and link to a field where the field is UDF that is created for example in marketing document. You must create UDF and user define table.
    Here is the definition from SDK help file :
    Create user tables according to the type of your object, Master Data or Document.
    If required, create also child user tables that must match the object type as follows:
    For Master Data type object choose Master Data Lines.
    For Document type object choose Document Lines.
    Register your object using the Registration wizard.
    Optional - To extend your object functionality, develop a business logic implementation (DLL) and then link it your UDO using the Registration wizard.
    Optional - If you would like to link a customized user form to your object (other than the default form available through the Registration wizard) use the UI API to create a user form.
    let me know if you need further detail info
    Rgds,

  • I have a problem to add data with UDO.

    this is my code:
      Try
                Dim oCompService As SAPbobsCOM.CompanyService
               oCompService = ap.oCompany.GetCompanyService()
               ap.oCompany.StartTransaction()
                Dim oDocGeneralService As SAPbobsCOM.GeneralService
                Dim oDocGeneralData As SAPbobsCOM.GeneralData
                ''in this line is the Error. ***
                +*oDocGeneralService = oCompService.GetGeneralService("MyDocUDO")*+       
      Catch ex As Exception
                If (ap.oCompany.InTransaction) Then
                    ap.oCompany.EndTransaction(SAPbobsCOM.BoWfTransOpt.wf_RollBack)
                End If
       End Try
    in this line trought a exception that it said: "Interface not registered". I think the problem is the object oCompService but I don't know solved. Anyone Can Help me??
    Thanks.

    ...you are sure you have created the UDO "MyDocUDO" ? that error appears in the case that there is any UDO with that name, to verify if this UDO exists go in Business One to Menu Tools --> Customisation tools --> Objects registration wizard, in the wizard click next -> update existing object -> next : you will see the list of existing UDO....
    I have verified that the object exists, even I have verified it in the table OUDO. I think that the error owes to the DLL SAPBOSCOM, but i don,t know solved it.
    Thanks.

  • Implementation DLL Name (Linking business logic implementation)

    Dear Sirs,
    The 'User-Defined Object Registration Wizard' requires the "Implementation DLL Name" file.
    Would appreciate it very much if someone could kindly advice where I can find relevant information or provide me with how-to generate the DLL file.
    Best Regards,
    Kunitomo - Tokyo

    Hi Kunimoto,
    Do you have access to the SDK Help Center now?
    It is also available on the SDN for download under:
    > SAP Business One > Versions > SAP Business One 2007
    > [SAP Business One 2007 SDK Help Center|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/9039f9c0-b9f1-2a10-27bd-b08d4bd9d48c]
    Notice that this is not the latest version available at the moment it should be updated soon. From there you all the information required as Niall said under
    > Customization Tools > User-Defined Objects (UDOs) > Creating a UDO
    Should you have any more specific questions let us know.
    Kind Regards,
    Friederike Mundt
    SAP Business One Forums Team

  • UDO Data Import

    Dear everyone,
      I defined some UDO and try to import the excel data into B1.  Any tools can do this??  Since, DTW seem not support UDO.
    Regards,
    Kit

    Hi Kit,
    The UDO support in DI API was by far the most wanted feature in our recent small survey in this Forum (don't know whether you have seen it...) - and the lacking suupport was discussed in this Forum a lot of times earlier...
    There are 2 consistent + compliant workarounds (which won't really resolve all cases or have other implications:
    1) Upload UDO records when calling UserObjectMD.Add() in a flat file. This is documented in the SDK Helpcenter and should work when the UDO definition is added.
    I need to check what happens when this definition would be deleted / readded - maybe that would work …
    Consequences when the delete / readd would work:
    <b>Pro:</b> Would require only DI API (+ providing the right file format) - if it works at all
    <b>Con:</b> All logged on users would get the message about changes in the DB structure… - unless this would be suppressed by an Add-On?!
    2) Use another (dummy) UDO to have the Implementation DLL of that (dummy) UDO called when working in the B1 application…
    ... and import the data there (shown in a RKT WebEx (aka Live Expert session)) - but did only worked for one line so far (still need to talk to R&D to check whether this is a lack of knowledge / a strange feature / bug)...
    <b>Pro:</b> Can be repeated without disturbing other processes / users...
    <b>Con:</b> Requires C++ skills so far; need to clarify how to add multiple lines; cannot be used without using the B1 application today.
    Regards,
    Frank

  • Register UDO

    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

    Hi
    See this working example.
    Private Sub Add_UDO(ByVal c_UDO As CUdo)
      Dim oUserObjectMD As SAPbobsCOM.UserObjectsMD
      Try
          Dim lErrCode As Long = 0
          Dim sErrMsg As String = ""
          oUserObjectMD = SBO_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserObjectsMD)
          If oUserObjectMD.GetByKey(c_UDO.Code) = 0 Then
           ' General Information
           ' +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
           oUserObjectMD.Code = c_UDO.Code ' "UDOBDGM"
           oUserObjectMD.Name = c_UDO.Name ' "Budget Mensile"
           oUserObjectMD.ObjectType = c_UDO.ObjectType ' SAPbobsCOM.BoUDOObjType.boud_MasterData
           oUserObjectMD.TableName = c_UDO.TableName ' "O01_BDGTEM"
           ' Services
           ' +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
           oUserObjectMD.CanCancel = c_UDO.CanCancel
           oUserObjectMD.CanClose = c_UDO.CanClose
           oUserObjectMD.CanCreateDefaultForm = c_UDO.CreateDefaultForm
           oUserObjectMD.CanDelete = c_UDO.CanDelete
           oUserObjectMD.CanFind = c_UDO.CanFind
           oUserObjectMD.CanYearTransfer = c_UDO.CanYearTransfer
           oUserObjectMD.ManageSeries = c_UDO.ManageSeries
           ' Log
           ' +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
           If c_UDO.LogTableName.Equals("") Then
               oUserObjectMD.CanLog = SAPbobsCOM.BoYesNoEnum.tNO
               oUserObjectMD.LogTableName = ""
           Else
               oUserObjectMD.CanLog = c_UDO.CanLog
               oUserObjectMD.LogTableName = c_UDO.LogTableName
           End If
           ' DLL Extension Name
           ' +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
           oUserObjectMD.ExtensionName = c_UDO.ExtensionName
           ' Find Columns
           ' +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
           Dim i As Integer = 0
           oUserObjectMD.FindColumns.SetCurrentLine(i)
           oUserObjectMD.FormColumns.FormColumnAlias = "Code"
           For Each sColName As String In c_UDO.FindFields
               If Not sColName.Equals("Code") Then
                i += 1
                Call oUserObjectMD.FindColumns.Add()
                oUserObjectMD.FindColumns.SetCurrentLine(i)
                oUserObjectMD.FindColumns.ColumnAlias = sColName
               End If
           Next
           ' Child Tables
           ' +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
           If Not oUserObjectMD.ChildTables.Count = 0 _
           And Not c_UDO.Children Is Nothing _
           Then
               If c_UDO.Children.Count > 0 Then
                Dim oUserObjectMD_ChildTables As SAPbobsCOM.UserObjectMD_ChildTables
                oUserObjectMD_ChildTables = oUserObjectMD.ChildTables
                i = -1
                For Each sChildTable As String In c_UDO.Children
                    i += 1
                    If i > 0 Then
                     oUserObjectMD_ChildTables.Add()
                    End If
                    oUserObjectMD_ChildTables.SetCurrentLine(i)
                    oUserObjectMD_ChildTables.TableName = sChildTable
                Next
               End If
           End If
           ' +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
           ' ADD UDO +++
           ' +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
           If oUserObjectMD.Add() <> 0 Then
               Call SBO_Company.GetLastError(lErrCode, sErrMsg)
               Throw New Exception("ERROR: NEW UDO [" & c_UDO.Code & ":" & c_UDO.Name & "]: " & sErrMsg)
           Else
               Dim str As String = ""
               str = "UDO [" & c_UDO.Code & ":" & c_UDO.Name & "] created correct."
               log(str)
               Application.DoEvents()
           End If
          Else
           Dim strMsg As String = "UDO [" & c_UDO.Code & ":" & c_UDO.Name & "] exist'."
           log(strMsg)
           Application.DoEvents()
          End If
      Catch ex As Exception
          Dim s As String = "ERRORE: " & ex.Message
          log(s)
      Finally
          If Not oUserObjectMD Is Nothing Then
           System.Runtime.InteropServices.Marshal.ReleaseComObject(oUserObjectMD)
           oUserObjectMD = Nothing
          End If
          System.GC.Collect()
      End Try
    End Sub
    Regards
    Sierdna S.

  • B1DE 2.0 UDO Class

    Hi,
    I'm using SAP B1 8.8 with B1DE 2.0
    I have found the following issues that I need feedback on:
    1. When creating a UDO Class for a Master Data object with the B1DE wizard it fails to create the class if the Master Data object is not linked to a child Master Lines object
    2. I also get a Int_Fields88.dll file not found error when running the wizard, but the wizard continues.
    Any feedback on the above 2 issues would be appreciated.
    .Ben

    Hi Mike,
    B1DE is B1 Development Environment, a wizard helping to develop addons using the SDK.
    You can find more information about B1DE, the tools included and how to download and install them at http://www.sdn.sap.com/irj/sdn/index?rid=/webcontent/uuid/a175fb62-0c01-0010-a8b5-fa58a13b1cf7 [original link is broken]
    There is not yet a B1DE version for B1 8.8, but it will come soon (some weeks).
    Regards
    Trinidad.

  • Validation For UDO Screens

    Hi All,
    I am working on UDO Concepts. I created one UDO With One  Document Table and Two Document line tables. It's Working fine. i created Addon and Run On Server machine and client machine it's working fine  the main problem is I Stop The addon But My Form is in Open  when i enter the values in that open form the values are added in the database without my validations. how to restrict  this type of problems.
    Thanks & Regards
    Naresh.K

    Hi Naresh,
    You cannot block the UDOs for working alone.
    You have developed your UDO form or you are using the default one?
    If you are using the default one it will be more dificult to block as the menu is automatically created by B1 and the only way to block it is from your addon. If your addon is not working then the UDO form can be open from the Tools -> Default Forms menu.
    If you have develop your own form then you need to close your UDO forms before you stop your addon and also remove the menus allowing to open your form. This way the user will not be able to use your UDO form to add/modify your UDOs.
    If you cannot assure to close the UDO forms before your addon is stopped then the user can continue using it without your permission.
    Another possibility is to develop a C++ implementation dll that will be registered when you define your UDO. This dll will be then run by B1 even if your addon is not running. For more information on the UDO implementation dll just check the SDK help file: Customization Tools -> User Defined Objects -> Extending Business Logic.
    Hope it helps
    Trinidad.

  • Running workbook from .bat fails to start application missing CORE40 dll

    I have been running several workbook via windows task scheduler / vbscript &/or bat files.
    I now have a new box which I access thru Remote Desktop Connection, so I can run all these automated updates without having my screen blinking everytime a shedule workbook starts.
    If I click on the actual Discoverer icon, or the discoverer workbook shortuct, all works well.
    If I click on the .bat file, or try to run the workbook via the cmd , it gives me the following error:
    DIS4USR.EXE – Unable To Locate Component
    “this application has failed to start because CORE40.DLL was not found. Re-installing the application may fix this problem.”
    The dll is under c/orant/bin/core40.dll, which is where I've read it should be, and it works fine in my regular box...
    Please help! URGENT :)
    Thanks!

    Hello
    Check the PATH environment variables for the machine you are on and the one you are connecting to.
    You might not have Discoverer's objects in the PATH.
    Another possibility is that you have more than one piece of ORACLE software on the machine and you may need to also set the ORACLE_HOME within the BAT file.
    Best wishes
    Michael

Maybe you are looking for

  • I can't hear sound after upgrading to lion

    I have this little annoying problem with my iMac after upgrading to Lion OSX. After waking up my iMac I can't hear any sound from internal speakers, ie: only video on Youtube, but no sound, but whilst pressing volume up/down button I can hear beep. W

  • I-tunes, Video Error, Windows XP

    Just upgraded to i-tunes 6. Can purchase music & videos fine - - and music downloads perfectly as usual. However, when the download of the purchased video begins, I immediately get an error that reads "There was an error downloading your purchased mu

  • SAP MM Important report

    Dear SAP Experts, In our company, per day (any one day) they want to see report as follows. Can anyone tell me, how to get it this report. I will be thankful to you all. List of Purchase Requisition List of Release Purchase Requistion List of Request

  • How can I get Sender Display Name using Get-MessageTrackingLog?

    Hi, could you please help me. We have got a monitoring system at work which monitors some devices, so if something wrong happening with these devices email is sent from MASTER email (Customer Name <[email protected]>) to us. I'm trying to get a list

  • Add Change/Edit button in ALV

    Hello Experts,                How to insert the button in ALV grid toolbar. Now its showing Check,insert,append and delete button.How to add change or edit button in ALV ? I'm using ALV componenet  SALV_WD_TABLE. Thanks.