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.

Similar Messages

  • 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

  • B1DE: GetByKey() - Invalid row

    Hello,
    I am using the B1DE to update UDO with GeneralService by using GetByKey () .
    The problem is when I do GetByKey () to one of records that its child table has blank entries,
    I receive the error message "Invalid Row".
    Does anyone know why this happens? What should I do?
    Thanks.

    Hi,
    I found my problem.
    In my code I deleted empty rows to child table, before the GetByKey().
    If there is a child table of the UDO that empty for one DocEntry, then B1DE failed in GetByKey for this DocEntry.

  • Problem Connecting B1DE UDO Form Generator in SAP 8.8

    Hello All,
    I have installed the B1DE Tool for SAP 8.8 Patch - 17 machine but while running the UDO Form Generator
    when i am ginving the User Name & Password of the selected company then system throws an error
    "ERROR - Connection to Company Failed ; Resource Error "
    and i am not able to use the UDO Form Generator .
    Please suggest how to resolve this problem,
    Thanks
    Amit

    Hi AmitSharma_061985
    you can download B1DE UDO new version here http://www.sdn.sap.com/irj/sdn/downloads?rid=/webcontent/uuid/a175fb62-0c01-0010-a8b5-fa58a13b1cf7 [original link is broken]
    1.change name server (server database)
    2.user name and password must have lincence.
    Regards
    H

  • B1DE Advanced setup and creating UDO object during installation

    Hi,
    I am developping addons on B1 2007B and use the B1DE advanced setup package.
    Is there a way in the CustomInstallerClass to connect to the B1 Application to create UDO tables ?
    Regards,
    Grégory

    Hi Gregory,
    Tables and UDOs creation in DI API should not be done during installation. You should do that in your addon after connecting to the DI API.
    You need some code in your addon checking whether the UDT, UDF, UDOs,... already exist, if they don't exist then you create them. You can manage that with a user table were you can keep the current version of your installed addon, this way you can know whether you need to create/update something in your Db every time you start your addon or not.
    Regards,
    Trinidad.

  • Problem in database fields creation using default class of B1DE Wizard

    Hi Experts
    In an AddOn I am creating database fields in default class "Project_DB'. It does not give any message weather it creates fields or not. My code for database creation is given below
    Namespace FormARE
        Public Class FormARE_Db
            Inherits B1Db
            Public Sub New()
                MyBase.New
                B1Connections.theAppl.StatusBar.SetText("Please wait. AddOn is updating database", BoMessageTime.bmt_Long, BoStatusBarMessageType.smt_None)
                Columns = New B1DbColumn() {New B1DbColumn("OCRD", "BondNo", "Bond No.", BoFieldTypes.db_Alpha, BoFldSubTypes.st_None, 20, New B1WizardBase.B1DbValidValue(-1) {}, -1), New B1DbColumn("OCRD", "BFrDate", "Bond From Date", BoFieldTypes.db_Date, BoFldSubTypes.st_None, 10, New B1WizardBase.B1DbValidValue(-1) {}, -1), New B1DbColumn("OCRD", "BTDate", "Bond To Date", BoFieldTypes.db_Date, BoFldSubTypes.st_None, 10, New B1WizardBase.B1DbValidValue(-1) {}, -1), New B1DbColumn("OINV", "Cntner_no", "Container No.", BoFieldTypes.db_Alpha, BoFldSubTypes.st_None, 20, New B1WizardBase.B1DbValidValue(-1) {}, -1), New B1DbColumn("OINV", "Cntnr_Seal", "Container Seal No.", BoFieldTypes.db_Alpha, BoFldSubTypes.st_None, 20, New B1WizardBase.B1DbValidValue(-1) {}, -1), New B1DbColumn("OINV", "Cust_Seal", "Custom Seal No.", BoFieldTypes.db_Alpha, BoFldSubTypes.st_None, 20, New B1WizardBase.B1DbValidValue(-1) {}, -1), New B1DbColumn("OINV", "ctryOrgn", "Country of Origin", BoFieldTypes.db_Alpha, BoFldSubTypes.st_None, 20, New B1WizardBase.B1DbValidValue(-1) {}, -1)}
                GC.Collect()
                B1Connections.theAppl.StatusBar.SetText("Successfully updated database", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Success)
            End Sub
        End Class
    End Namespace
    It does not give first message. and second message come properly and immediately when I start the AddOn. I checked it makes all fields accuratly. But when I open the related form it gives error message "Data Source not found". I checked fields name are same as used in form and database .What can the reason? Should I use a simple function for creation of database fields which will run when a button is pressed? Is it fine to using default class for database fields creation?
    Thanks
    Best Regards
    Jitender

    I solved the problem.
    Procedure I followed :
    UNINSTALL ORACLE WRAEHOUSE BUILDER SOFTAWARE.
    'GLOBAL_NAMES = FALSE' in init.ora file.
    RESTARTED MY MACHINE.
    INSTALL THE ORACLE WRAEHOUSE BUILDER SOFTAWARE.

  • B1DE - Help

    Hi in B1DE we having SAPB1 add0n Installerr.NET wizard which we are using to create ard for our Add-ons.
    but am not clear about VB B1 addon wizard and VBB1 add0n Installerr.NET wizard ... whats the purpose of both...
    To create setup for DI Application what we have to use?
    regards,
    Ganesh k

    Hi..
       See this documents...
    B1DE: B1 Development Environment tools
    Applies To:
    SAP Business One
    Article Summary
    This article describes a set of development tools for SAP B1: these tools leverage on the well known and established B1 SDK, on the .NET platform and on Microsoft Visual Studio .NET environment.
    By: SAP B1 Solution Architects
    Title: B1 Development Environment tools
    Creation Date: September, 20 2005
    Last Update: January, 2008
    Table of Content
    B1DE: B1 DEVELOPMENT ENVIRONMENT TOOLS     1
    APPLIES TO:     1
    ARTICLE SUMMARY     1
    TABLE OF CONTENT     1
    INTRODUCTION     3
    B1 CODE GENERATOR WIZARD     3
    B1 SIMPLE INSTALLER WIZARD     3
    B1 PROFESSIONAL INSTALLER WIZARD     3
    B1 UDO FORM GENERATOR     3
    B1 DB BROWSER     3
    B1 EVENT LOGGER     3
    B1 CODE GENERATOR WIZARD     5
    NOTE ON THE CODE     8
    B1 SIMPLE INSTALLER WIZARD     9
    NOTE ON THE CODE     11
    B1 PROFESSIONAL INSTALLER WIZARD     12
    NOTE ON THE CODE     14
    B1 DB BROWSER     15
    NOTE ON THE CODE     16
    B1 UDO FORM GENERATOR     17
    NOTE ON THE CODE     18
    B1 EVENT LOGGER     19
    FILTERING EVENTS     20
    NOTE ON THE CODE     21
    DISCLAIMER & LIABILITY NOTICE     24
    Introduction 
    The SAP Business One SDK provides several programming interfaces to build solutions. In this document we will present a set of software tools, called B1 Development Environment (B1DE) that make easier and quicker to develop and package add-ons based on these interfaces. These are the tools composing B1DE.
    B1 Code Generator Wizard
    This tool is composed of a set of Microsoft Visual Studio .NET wizards and add-ins that generate and update B1 add-ons, creating a complete solution in terms of:
         Source code (C# or VB.NET)
         XML menu and form files
         Microsoft Visual Studio .NET solution, including the references to the B1 type libraries
    The tool leverages on established B1 SDK best practices, on the .NET platform and on Microsoft Visual Studio .NET environment.
    B1 Simple Installer Wizard
    This tool is composed of a Microsoft Visual Studio .NET wizard that generates a solution containing the auto generated source code (VB.NET) already compiled and ready to register your add-on on the SAP Business One application.
    B1 Professional Installer Wizard
    The B1 Professional Installer Wizard generates a Microsoft Visual Studio .NET solution that will help you to create a .NET Setup and Deployment installer for your add-on.
    This wizard uses the Visual Studio .NET Setup and Deployment technology to create a professional looking installer with built-in setup options. This installer is more suitable for experienced .NET developers who are familiar with .NET Setup and Deployment projects.
    B1 UDO Form Generator
    This tool generates an XML form starting from a UDO definition. It can be started from the B1 Code Generator Wizard or directly executed as a Window application.
    B1 DB Browser
    This tool visualizes the current status of a B1 database in terms of the tables currently defined, their columns and properties as name, types, default values and database constraints. It shows also the differences between the current release of B1 and a previous one. It can be started from the B1 Code Generator Wizard or directly executed as a Window application. Note that this tool is also used during solution certification and then it is also included in the B1 Test Environment documentation.
    B1 Event Logger
    Event Logger is a tool that allows you to easily visualize all UI API events fired by the SAP Business One application. You can easily use this tool to analyze the different events fired depending on the user actions and observe the information given by each event; it can be very useful as a first step before specifying which events your add-on needs to manage.
    B1DE setup installs all these tools by default in Program FilesSAPSAP B1 Development Environment and it adds in the Microsoft Visual Studio .NET folders all the configuration files needed to integrate with the development environment itself.
    See MSDN to get information about the integration with Microsoft Visual Studio .NET.
    B1 Code Generator Wizard
    The B1 Code Generator Wizard generates a B1 add-on in form of a Microsoft Visual Studio .NET solution according to the choices of a B1 SDK programmer.
    Once installed, the wizards can be called by Visual Studio .NET with the following steps:
         go under File / New / Project u2026,
         select the project type Visual C# Project (or Visual Basic Project),
         then select u201CC# B1 AddOn Wizardu201D (or u201CVB B1 AddOn Wizardu201D)
         and finally press OK.
    At this point if SAP Business One is running in the same machine a SSO connection will be done to have access to the UI API (menus shown by the wizard will be based in current B1 menus). If no SAP Business One is running a connection window is open (see Figure 13), in this case only a DI API connection will be done and the menus will be fixed (base on a wizard file). Once successfully connected to a B1 company the wizard will present four panes, a first one for the connection and one for every type of B1 objects.
    Connection pane
    The first pane presents three choices for the connection with the B1 SDK. The programmer can select the type of connection needed for the add-on (see Figure 1).
    Figure 1: Connection pane.
    Data Base pane
    The first pane presents a view of the tables and UDO present in a company DB. With mouse clicks the programmer can add tables, fields and UDO (see Figure 2).
    Figure 2: Database pane.
    This is the first pane of the wizard.
    The tree on the left contains all the system and user tables and all user defined objects in the connected company. A right-click context menu is active on the tree enabling:
         To view the definition of a table (activating the B1 Db Browser) and of a UDO
         To add a new user table
         To add a new user field
         To add a new key
         To add a new UDO
    When an item is added a new tab page is added on the tab on the right. It is possible to remove the tab page by right clicking on the tab page itself and selecting Remove. No code generation is done until the Finish button is pressed and then it is possible to undo the choices until the solution is generated.
    Menus pane
    The second pane presents a view of all the system menus present in the B1 desktop. With mouse clicks the programmer can add, update or delete menus, add listeners to menus, or attach forms to them (see Figure 3).
    Figure 3: Menus pane.
    The tree on the left contains all the system menus in B1 application. A right-click context menu is active on the tree enabling:
         To add, delete or update a menu
         To attach a user form to a menu: it is possible to attach an already existing XML form or to generate on the fly a form from a UDO (activating the B1 UDO Form Generator).
         To add a listener to a menu
    When a new operation is selected a new tab page is added on the tab on the right. It is possible to remove the tab page by right clicking on the tab page itself and selecting Remove. No code generation is done until the Finish button is pressed and then it is possible to undo the choices until the solution is generated.
    Forms pane
    The third and final pane presents a view of the forms in the system and all their related items. With mouse clicks the programmer can add listeners to the different events that can be raised by forms and items (Figure 4).
    Figure 4: Forms pane.
    The tree on the left contains B1 forms and their related items grouped by type, plus some form-related information. A right-click context menu is active on the tree enabling:
         To view a form under the Forms node
         To add a listener to a form or to an item
    When a listener is added a new tab page is added on the tab on the right. It is possible to remove the tab page by right clicking on the tab page itself and selecting Remove. No code generation is done until the Finish button is pressed and then it is possible to undo the choices until the solution is generated.
    The programmer can then navigate back and forward across these panes and do and undo all the choices needed in the add-on in terms of tables, UDO, menus, forms and items. When all the choices are done and the Finish button is pressed (and only then), a new Visual Studio .NET C# (VB.NET) is generated.
    It is very important to notice that the code generated by the wizard uses a set of classes that implements B1 SDK best practices. These classes encapsulate safe and performing plumbing logic and then the B1 SDK programmer can concentrate on the functional side of the add-on leaving to them all the integration implementation. In particular:
         All the add-on initialization is handled by the classes B1AddOn and B1AddOnDb. The wizard generates a subclass of B1AddOn that initializes the connections with the desktop and with the company DB and then implements a standard behavior accordingly to what was specified.
         The add-on adds tables and objects to the DB if needed,
         creates, updates and deletes menus
         and then finally waits for events.
         All the event handling involved in a classic B1 add-on is hidden on a set of classes (B1Form, B1Item, B1Menu and B1Listener) and presented in form of a high-level listener-based interface. A listener is here a method marked with a custom attribute (B1Listener): the wizard run-time takes care of all the event registration, routing and filtering. The wizard collects then listeners together in classes representing B1 forms, items and menus leaving then to the programmer to implement the functional part. Figure 14 contains an example of a class generated by the wizard.
    The programmer can still access to all the B1 SDK objects by using the container class B1Connections that has the DI and the UI connections as properties.
    Besides the tool provides also add-ins that makes possible to add new objects or update the existing ones into an existing solution previously generated by the wizard. These add-ins can be accessed by Visual Studio .NET with the following steps:
         go under File / Add New Item u2026
         select u201CC# B1 AddOn Componentu201D (or u201CVB B1 AddOn Componentu201D) to add a menu, form or item
         select u201CC# B1 AddOn Listeneru201D (or u201CVB B1 AddOn Listeneru201D) to add a new listener
    Note on the code
    The code for this tool is contained in the solution B1Wizard. This solution compiles as a class library that is used to run the wizard and generate the solution and also at run-time. The class library is composed of many parts:
         The wizard itself: contains classes like AddOnWizard, AddOnSolution and so on and implements all the integration with the Visual Studio .NET.
         The wizard GUI: contains classes like WizardForm, WizardPage, TabPage and so on and implements all the wizard GUI using Windows Forms.
         The generation engine: contains classes like AddOnGenerator or XmlFormGenerator. It implements all the generation of the source code (using CodeDom .NET namespace) or the form and menu XML files (using directly System.Xml)
         The run-time: contains classes like B1ListenerAttribute, B1AddOn, B1Db, B1Form and so on. It implements all the B1 SDK best practices, including connections, creation of tables, fields and UDO, event registration, routing and filtering and the likes. These classes will be accessed by the solution during its run-time and uses (and hides) all the B1 SDK basic mechanisms.
         The B1 Db Browser tool: contains classes like B1DbTableForm, B1DbBrowser, B1DbTable and so on. It implements the B1 Db Browser tool: the metadata are read by using DI API metadata objects or accessing the DB metadata information directly with an OleDB connection.
    Check MSDN to get more information on the mentioned .NET mechanisms.
    B1 Simple Installer Wizard
    The B1 Simple Installer Wizard generates a Microsoft Visual Studio .NET solution ready to register your add-on on a SAP Business One application.
    Once installed, the wizard can be called by Visual Studio .NET following the steps:
         go under File / New / Project u2026,
         select the project type Visual Basic Project,
         then select u201CVB B1 AddOn Installer .NET Wizardu201D
         and finally press OK.
    At this point a the wizard will present two steps, one to specify general parameters needed for the registration and a second one where to specify the files needed to run the add-on (exe file, DI API and/or UI API references and all the resources files).
    General Information step
    This step will ask for general parameters needed to create the registration file needed to register the add-on on the SAP Business One application prior to the installation. Figure 5 shows this first step.
    Figure 5: AddOn general information.
    The parameters this step will ask are:
         Application Name - Add-on name.
         Version - numeric string indicating your add-on version.
         Estimated Installation Time - estimated time to complete the installation. Valid range: 1 to 3,600 seconds.
    Take into account that installation may take longer on customer machines as they often employ weak or slow machines.
         Estimated Uninstallation Time - estimated time to complete uninstallation. Valid range: 1 to 3,600 seconds.
         Restart needed after installation u2013 the machine needs to be restarted after the installation.
    Add-on files step
    This step will ask for all the files needed by the add-on to correctly run. Figure 6 is showing this second step.
    Figure 6: AddOn basic files.
    Mandatory information to be filled at this step is the executable of the add-on we want to create the installer and the references to the DI API and/or UI API interop dlls used.
    Extra files needed by the add-on to correctly run should be added in extra panes, you can add new panes by clicking on the addfiles button (bottom-right of the window). There can be added as many extra panes as needed, each extra pane containing four files.
    After this two steps done click finish on the wizard window.
    The result of this wizard will consist on the creation of a solution including one Vb.NET project already completed with all needed classes and information entered by the user and compiled. Inside the bin directory of the project will be located the two files needed to register the add-on into the B1 application: The installer executable and the .ard registration file.
    The auto generated project is composed of the following classes:
         Four controls (InstallMain, InstallPath, InstallEnded, Unisntall) that will represent the steps shown to the used during the add-on installation/uninstallation (together with the base classes BaseForm and BaseControl).
         The AddOnInstallInfo class containing the registration and installation information entered by the user.
         The AddOnInstallManager class responsible for the creation of the registration file (.ard) and the complete procedure of the add-on installation following the rules fixed by the SAP Business One add-ons packaging procedure (please have a look to the Package and Deployment section of the SDK help files for more information).
         A directory called AddOnFiles containing all the add-on needed files (entered in the second step of the wizard) as embedded resource.
    Note on the code
    The code of this wizard is contained inside the solution called Installer.NETWizard located inside the B1 DE sources, AddOnInstallerWizards section.
    The main and only project inside the solution is composed of three parts:
         The wizard itself: contains classes like AddOnInstallerWizard, AddOnInstallerSolution and implements all the integration with the Visual Studio .NET.
         The wizard GUI: contains classes like WizardForm, WizardPage, TabPage and implements the entire wizard GUI using Windows Forms.
         The generation engine: contains classes like AddOnInstallerGenerator. It implements all the generation of the source code (using CodeDom .NET namespace).
    B1 Professional Installer Wizard
    The B1 Professional Installer Wizard generates a Microsoft Visual Studio .NET solution that will help you to create a .NET Setup and Deployment installer.
    Once installed, the wizard can be called by Visual Studio .NET following the steps:
         go under File / New / Project u2026,
         select the project type Visual Basic Project,
         then select u201CVB B1 AddOn Installer Setup .NETu201D
         and finally press OK.
    At this point the wizard will present two steps: one to specify general parameters needed for the registration and a second one where to specify the exe file of the add-on.
    General Information step
    This step will ask for general parameters needed to create the registration file needed to register the add-on on the SAP Business One application prior to the installation. Figure 7 shows this first step.
    Figure 7: AddOn general information.
    The parameters this step will ask are:
         Application Name - Add-on name.
         Version - numeric string indicating your add-on version.
         Estimated Installation Time - estimated time to complete the installation. Valid range: 1 to 3,600 seconds.
    Take into account that installation may take longer on customer machines as they often employ weak or slow machines.
         Estimated Uninstallation Time - estimated time to complete uninstallation. Valid range: 1 to 3,600 seconds.
         Restart needed after installation u2013 the machine needs to be restarted after the installation.
    Add-on exe file step
    This step will ask for the add-on exe file. Figure 8 is showing this second step.
    Figure 8: AddOn exe file.
    After this two steps done click finish on the wizard window.
    The result of this wizard will consist on the creation of a solution including three Vb.NET projects.
         A main project Vb.NET with the same name as the solution. This project generates the installer executable file used to register the add-on into the SAP Business One application.
         A project called Setup of type .NET Setup and Deployment project.
         A project called CustomerLibrary of type library. This project is responsible for the communication between the installer and the SAP Business One application. The Setup project calls this project at different stages of the installation
    After the wizard generates the solution the user has to complete and configure the Setup project as usual for a .NET Setup and Deployment. The instructions to follow are clearly described in the TODO.txt file included on the main project. After following these steps the exe file of the main project will be the installer of the add-on to be used for the add-on registration on the SAP Business One application. The .ard file will be auto generated by the wizard and located inside the bin directory of the main project.
    Note on the code
    The code of this wizard is contained inside the solution called InstallerSetup.NETWizard located inside the B1 DE sources, AddOnInstallerWizards section.
    The main and only project inside the solution is composed of three parts:
         The wizard itself: contains classes like AddOnInstallerWizard, AddOnInstallerSolution and implements all the integration with the Visual Studio .NET.
         The wizard GUI: contains classes like WizardForm, WizardPage * and implements the entire wizard GUI using Windows Forms.
         The generation engine: contains classes like AddOnInstallerGenerator. It implements all the generation of the source code (using CodeDom .NET namespace).
    B1 DB Browser
    B1 DB Browser is able to browse the current status of a B1 database in terms of metadata and present a synthetic and navigable view of the table in the database. Figure 9 shows a table definition as presented by this tool.
    Figure 9: B1 DB Browser main window.
    The tool merges together information taken using B1 SDK metadata functions and .NET database services and presents them in a grid.
    A tree view in the left side presents 5 main nodes:
         Advanced DB Objects: Extended stored procedures, Inlined table-functions, Replication filter stored procedures, Scalar functions, Stored procedures, Triggers and Views.
         B1 Tables: All B1 system tables
         UDFs: User Defined Fields grouped by table name.
         UDOs: User Defined Objects
         UDTs: User Defined Tables
    Each table node in the tree view includes the list of fields, user defined fields, keys and related tables inside it.
    Per each main node/sub node the relating information is presented in a grid. The columns on the grid depend on the type of object to be shown.
    Per each table the grid shows the list of its fields with the following information per each field:  
         The name of the field
         The description of the field
         The type of the field
         The linked table to the field, if any
         The length of this name
         Whether the field is nullable
         The default values associated to the field, if any
    Starting on 2005 SP01 version a tool bar button offers the possibility to visualize the DbChanges list regarding the precedent version: New, Modified, Deleted Tables & Fields & Keys.
    Note on the code
    The code for the Db Browser has B1DbBrowserTool class as main class.
    This class is contained in the solution B1Wizard and uses:
         DI API metadata objects to access the UDO and tables information
    B1 UDO Form Generator
    The B1 UDO Form Generator generates a B1 XML form starting from a UDO definition in a B1 DB. The tool can be executed directly or called when attaching a form to a menu.
    The tool just scans the definition of a UDO in terms of fields and children tables. Based on this information it creates then a B1 XML form, adds items to the form according to a simple layout and binds them to the corresponding fields and tables. These are the basic rules followed by the tools when generating the form.
    Items
    Every field in the main table has a corresponding item in the form to which it is bound:
         if a field has default Yes/No values it adds a check box to the form,
         otherwise if a field has a set of default values it adds a combo box to the form,
         otherwise it adds a text field.
    Child table
    Child tables are added in form of matrixes in different folders. Columns are added to the matrix in relation with the fields in the child tables following the same rules as above.
    Data binding
    The form is then bound to the UDO itself ensuring all the data handling as creation, deletion and update. Navigation is ensured based on the key of the master table either in case of MasterData and Document object type.
    Figure 10 contains a form generated by this tool.
    Figure 10: B1 UDO Form Generator.
    Note on the code
    The code for the form generator is contained in the class XmlFormGenerator.
    This class is contained in the solution B1Wizard and uses:
         DI API metadata objects to access the UDO and tables information
         System.Xml .NET namespace to create the XML form
    B1 Event Logger
    The Event Logger tool listens for all events fired by the UI API interface and shows one line per each event in a .Net Grid. The information shown per each event depends on the event type. Per all events the same columns are shown, the information will be relevant or not depending on the event type.
    Figure 11 shows the main B1 Event Logger window.
    Figure 11: Main window of the B1 Event Logger.
    The information shown per each event is:
         EventType
    Returns a value indicating the type of the handled event.
         BeforeAction
    Returns a boolean value specifying whether or not the application sent the event's before notification.
         Success
    When ItemEvent.BeforeAction = False, returns a boolean value specifying whether or not the application handled the event successfully.
         FormType
    Returns a string specifying the type of the form getting the event (FormTypeEx).
         FormCount
    Returns the form number within the type.
         ItemUID
    Returns the item ID number for item events. 
         ColUID
    Returns the column ID for matrix items only.
         Row
    Returns the item row for matrix items only.
         FormUID
    Returns the unique ID of the form in which the event occurred.
         FormMode
    Returns the form mode in the SAP Business One application.
         CharPressed
    Returns the character that was pressed in the ItemEvent event.
         InnerEvent
    Returns a boolean specifying whether or not this event is internal.
         ItemChanged
    Returns a value specifying if an item was changed by the SAP Business One engines during the event process (is valid only when the Before_Action property is set to Off).
         Modifiers
    Returns a value specifying the pressed key in a et_KEY_DOWN event.
         PopUpIndicator
    Returns the row in a popup list when handling popup event.
    If you want to obtain more information regarding events in the UI API please have a look to the DI API Help File, section u201CHow to -> Handle Eventsu201D.
    Filtering Events
    You can add a filter to the Event Logger to show only the events you are interested in per form.
    Just press the Filter button in the tool bar and a new window appears giving you the possibility to choose per each form the events you want to see (cf. Figure 12).
    Figure 12: Filters management window.
    If you want to remove the current filter and receive all events you only have to press the button u201CNO Filteru201D in the Filters Management window.
    If you need to remove the list to create a complete new filter you can use the right button click menu and choose Delete All. You can also delete only a specific event from the filter by selecting it and choosing Delete Current Line.
    Note on the code
    The code of the Event Logger project is located in a separate solution inside the B1DE Source Code. It is a very simple project reproducing a simple add-on logging all events fired by B1 application.
    Figure 13: B1 Wizard DI API Connection parameters window.
    Connection form: insert the DB username and password and click on GetCompanyList button. CompanyDB combo-box will be filled with all the companies present on this database, select one, fill into username and password and press Connect. If needed, AddOnIdentifier can be typed too.
    public class Form__134 : B1Form {
    public Form__134() {
    FormType = "134";
    B1Listener(BoEventTypes.et_FORM_LOAD, false)
    public virtual bool OnFormLoad(ItemEvent pVal) {
    Form form = B1Connections.theAppl.Forms.Item(pVal.FormUID);
    // ADD YOUR ACTION CODE HERE ...
    return true;
    B1Listener(BoEventTypes.et_FORM_UNLOAD, true)
    public virtual bool OnBeforeFormUnload(ItemEvent pVal) {
    Form form = B1Connections.theAppl.Forms.Item(pVal.FormUID);
    // ADD YOUR ACTION CODE HERE ...
    return true;
    Figure 14: Sample of code generated by the B1 Code Generator Wizard.
    This code represents the system form of type 134 (Business Partner Master Data) to which have been attached two listeners:
         The first listener is OnFormLoad and is called when the form is loaded. A B1 SDK programmer can add some logic into this method and decide whether the system processing should continue or not by returning true or false.
         The second listener is OnBeforeFormUnload and is called before the form is unloaded. A B1 SDK programmer can add some logic into this method and decide whether the system processing should continue or not by returning true or false.
    The attribute B1Listener marks these methods as callbacks for B1 UI events.
    Disclaimer & Liability Notice
    This document may discuss sample coding, which does not include official interfaces and therefore is not supported. Changes made based on this information are not supported and can be overwritten during an upgrade.
    SAP will not be held liable for any damages caused by using or misusing of the code and methods suggested here, and anyone using these methods, is doing it under his/her own responsibility.
    SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of the technical article, including any liability resulting from incompatibility between the content of the technical article and the materials and services offered by SAP. You agree that you will not hold SAP responsible or liable with respect to the content of the Technical Article or seek to do so.
    Copyright © 2004 SAP AG, Inc. All Rights Reserved. SAP, mySAP, mySAP.com, xApps, xApp, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product, service names, trademarks and registered trademarks mentioned are the trademarks of their respective owners.     
    Regards...
    Billa 2007

  • How to change connection string for a form created with b1de

    Hi all
    i've created a form using the Code Generator tool ob B1DE
    My question is how can i set the connection string to a different server and database. doing so after the creation wizard has finished?

    Hi,
    Why do you need to change the connection string? What are you calling "connection string for a form"???
    The only connection string I now about is the one used to connect to the UI API... and this one is fixed for all apps in debug mode and given as parameter when your addon is registered in B1.
    The connection string is filled in the code of your generated addon.
    Please go to the main class of your addon, in the main method you have the following code where the connection string is filled either with the command line parameters (release mode) or with the fixed value given by SAP. This code doesn't need to be changed...
            public static void Main()
                int retCode = 0;
                string connStr = "";
                bool diRequired = true;
                // CHANGE ADDON IDENTIFIER BEFORE RELEASING TO CUSTOMER (Solution Identifier)
                string addOnIdentifierStr = "";
                if ((System.Environment.GetCommandLineArgs().Length == 1)) {
                    connStr = B1Connections.connStr;
                else {
                    connStr = System.Environment.GetCommandLineArgs().GetValue(1).ToString();
                try {
                    // INIT CONNECTIONS
                    retCode = B1Connections.Init(connStr, addOnIdentifierStr, diRequired);
    Regards
    Trinidad.

  • B1DE / PrintEvent  ..

    I am trying to think of a way to capture the output from a document print ( a sales invoice) so that i can do some additional processing on a subset of the printed items (export them to an external file) . I am using B1DE to create my application and the event handlers but i'm having a a problem with the printEvent  - namely where to put it and how to name it  ? I can add a handler to the "ok" button on the Document print dialog but this receives an ItemEvent and i'm not sure that this can or should be cast to a printEvent .. Is it just a case of capturing the print event from the main menu and doing all my processing within there  ?  I'm hoping the printEvent will hold the necessary info for me to extract what i want . In the main class B1DE generates a number of event handlers (eg OnShutDown(), OnCompanyChange() ...)  that i can overide but i dont see anything related to printEvents ..
    How can I handle this within B1DE framework  ? 
    Thanks  ..

    Thanks for the reply  .. I did try this within the main addon event handling application class generated by B1DE  ..
    In the constructor ..
    public Sample() {
                // ADD YOUR INITIALIZATION CODE HERE     ...
                // Add an event handler for the print event  ...
                B1Connections.theAppl.PrintEvent += new  SAPbouiCOM._IApplicationEvents_PrintEventEventHandler(myPrintEventHandler);
    and this for the event handler in the same class .. 
      private void myPrintEventHandler(ref SAPbouiCOM.PrintEventInfo pVal, out bool BubbleEvent)
                BubbleEvent = true;
                B1Connections.theAppl.MessageBox("The Print event has been sent", 1, "Ok", "", "");
    But the code is never called  ..  Would you happen to know if this is the correct way to add this handler
    via B1DE  ?
    As an aside i tried one of the samples provided in the SDK(2007A) but with a couple of small amendments  ..
    I used the "CatchingEvents" example but added the following 2 lines to register additional listeners ..
    // Try these additional events  .. 
            SBO_Application.PrintEvent += new SAPbouiCOM._IApplicationEvents_PrintEventEventHandler(SBO_Application_PrintEvent);
            SBO_Application.ReportDataEvent += new SAPbouiCOM._IApplicationEvents_ReportDataEventEventHandler(SBO_Application_ReportDataEvent);
    with this handling code ..
        private void SBO_Application_PrintEvent(ref SAPbouiCOM.PrintEventInfo pVal, out bool BubbleEvent){
            BubbleEvent = true;
            SBO_Application.MessageBox("The Print event has been sent", 1, "Ok", "", "");   
        private void SBO_Application_ReportDataEvent(ref SAPbouiCOM.ReportDataInfo pVal, out bool BubbleEvent)
            BubbleEvent = true;
            SBO_Application.MessageBox("The ReportData event has been sent", 1, "Ok", "", "");   
    These events didn't fire as expected either - they didn't fire at all . Can anyone see a problem with my implementation or my interpretation of the event handling  ?  ..
    Edited by: Rob Morning on Apr 8, 2008 2:59 PM

  • B1DE Addon Wizard

    Hi,
    I am trying to create UDO form from B1 Addon wizard. I could create UDO forms for Document object.While running that Addon code, i can add, find objects in that form. After that i tried to change edit box to combo through Screen paiter.When i try to run the same form once again, it doent provide any functionality like add, find or add new line in that form.
    How would I add combo box in UDO?I am using B1DE 2004.
    thanks and regards
    BBN

    Hi Nick,
    i changed edit field to combo box, renamed that UDO xml form to srf file then changed its type. When i try to run that UDO form, it shows all the fields, but not standard UDO form functionality.How would i bind datasource to that UDO form field. i tried to bind with one field in that table. But it gives bad datasource error.
    regards
    BBN

  • Error when adding UDO record

    Hi,
    Im using SAP B1 2007A SP00 PL11
    I'm getting the following error when attempting to add data using a custom form bound to a UDO.
    "Internal Error (3621) occured [Message 131-183]"
    The form was generated using the B1DE form generator and is a Document / Document Lines type form.
    The error is caused by a specific value in one of the fields in the Document Lines section. If I use another value it works correctly.
    Any info on what error 3621 is would be appreciated.
    Cheers,
    Ben

    Ben,
    The latest patch level for 2007A is PL 15 ... you may want to download and retry your code.
    Eddy

  • Query related to B1DE

    Hi,
    I have just started using B1DE which i found to good.
    Now what i have done is
    Loaded my ".XML" form.
    Now i dont know where to place this function to catch all events of ".XML" form.
    <i>Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent
    End sub
    </i>
    following files were generated by B1DE =>
    1. addMenus.xml
    2. AddOn1.vb
    3. AddOn1_Db.vb
    4. Form__2000060004.vb  AND
    5. Menu__PR1.vb
    Just tell me in which file i have to place my event function.
    Regards ,
    Ganesh

    Ganesh -
    you don't have to use this function. In fact this function
    is implemented internally by the wizard classes in order
    to provide you a listener-based interface.
    Pls read the documentation attached with the download

  • UDO / Date Type field ..

    Having problems with  UDO and a screen I've designed .. I have two dates in my UDO which i have bound to the display .. I attempt to prefill the dates with the following code ..
    form.DataSources.DBDatasources.Item("@MyTest").SetValue("U_StartDate",0, GenApp.DefaultStartDate.ToString());
    form.DataSources.DBDataSources.Item("@MyTest").SetValue("U_EndDate",0,
    GenApp.DefaultEndDate.ToString());
    form.Update();
    My GenApp is a static class contains the methods DefaultStartDate, DefaultEndDate which returns
    DateTime values ..
    The dates don't display in the screen , though the static class does return values .. Any one have any suggestions ?
    Thanks

    you are right - i forgot the two brackets - sorry
    i was in hurry to a vienna soccer match when i posted this solution....
    anyway a bit "helpful" no ?
    forget this joke - i noticed you generaly give no points
    David

  • UDO form generator tool ??

    Hi all
    could  u  help me  where it will be find UDO form  generator tool?
    plz help.. me....
    Edited by: Gangotri Infotech on Jan 14, 2008 9:01 AM

    UDO form generator will generate for you a B1 form in XML format starting from a UDO definition in your DB. It is included also in the VS.NET wizards for C# and VB.NET projects for B1 addons as part of the B1DE package.
    You can download the B1DE package directly from SDN under "Business One SDK tools" section in the B1 SDN home page.

  • Reasons for using B1DE ?

    Hi
    I have developed several applications for SAP using vb6 and have just coded one large one using the di api using vb.net.
    I need to start a small application which will use the ui api. I have played around at the moment by modifying one of the example ui .net programs and all seems ok.
    Reference the B1DE what are the main advantages to using it please ? will applications started by this be faster, more reliable, better in some way ?
    Any comments warmly received
    Thanks
    Regards Andy

    Some time ago this was discussed in this forum ....
    Reason for Using the B1DE and the Screenpainter?
    Let me give you a short view on B1DE and all the other tools. On SDN you can
    find now a set of tools that covers the whole development and support lifecycle:
    - B1DE (Development Environment) for design, prototyping and coding
    - B1TE (Test Environment) for profiling and ensuring adherence to dev guidelines
    - B1TC (Test Composer) for test automation and support
    All of these tools have been developed ON TOP of SDK so generally speaking
    every developers could have developed them. But they contain best practices
    known in development and they are ready to use. So using them will accelerate
    your solution development cycle - making you able to concentrate on the business
    logic rather than on the SDK mechanisms. It contains also some very useful
    rapid prototyping capability - as the possibility to generate automatically forms
    starting from an UDO or to generate automatically a setup program for your addon.
    We decided to concentrate on the .NET and Visual Studio environments because
    they are by far the most used environments by our partners. You can decide to
    use C# or VB.NET. If you come from VB6 world, I believe VB.NET will be your
    choice.
    Some facts here:
    - all the tools are delivered under the SDN license scheme and you can get also
      the source code together with all the user documentation to use them
    - in 2006 more than 5,000 people developed at one setup release of B1DE but also
      the source code have been downloaded - more than 2000 times
    - B1TE is used by SAP Integration and Certification Center for solution certification
      but beyond this has been downloaded more than 2,700 times
    - B1TC has been delivered only a couple of months ago. It can be used in several
      cases and has already downloaded almost 1,000 times

Maybe you are looking for