Skip to Content
author's profile photo Former Member
Former Member

Advatages/Differences developing addons with .net

Hi,

until now i developed my addons with vb6.

Now i have the opportunity to start using .net.

First of all, which version do you suggest? VS 2003 or VS 2005?

Which advtantages/differences should i consider?

Are there any special features?

Notice that i already use .net for other windows forms application.

Thanks

Paolo

Add a comment
10|10000 characters needed characters exceeded

Related questions

8 Answers

  • Best Answer
    Posted on Oct 24, 2006 at 09:03 AM

    Paolo hi -

    "Seems that i can add listners only if the class name of the form begins with 'Form__'. Is that correct?"

    The wizard takes care of generating classes and listeners

    for you. You select the objects you want to work with and

    then you add your functional code in the placeholders

    generated automatically for you. You don't need to care

    about the name of forms.

    "How do i use DI in this scenario?"

    The wizard generates for you an add-on that uses DI and

    UI. By using the singleton object B1Connections you can

    access the UI connection or the DI company and then you

    can do whatever you want with the DI objects.

    "Is there additional documentation or code samples?"

    The documentation comes with the package. If you want to

    see a live demo of the wizard go under TechSummit in the

    B1 home page and watch the B1DE section.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thank you, Gianluigi.

      I'm finding b1wizardbase very interesting.

      Some other questions:

      1.

      How do i add form through the wizard once the wizard has finished? i've seen if i choose 'add b1 addon component' a window open with two tabs. in the form tab i see 3 forms: 134, 139, 150. What does it mean? what can i do with that?

      2.

      Do i need to manage event filters if i use listeners?

      3.

      The init method of the B1Connections class has a parameter 'AddOnIdStr'. If it is blank i runs succefully otherwise i receive 'AddOn identifier is not valid'.

      Why?

      4.

      In the OnShutDown should i put some clean up code?

      By default it is empty.

      5.

      Class B1AddOn1_Db is always necessary?

      Thank again

  • Posted on Oct 23, 2006 at 09:18 AM

    Hi Paolo Fornari

    I would say that the main difference is that in you will now be able to use try/catch blocks and that alone is a huge advantage.

    If i was you i would go with VS 2005. Programming wise for SAP there is no real huge advantage between VS 2003 or VS 2005. But i myself prefer VS 2005 because there are more nice features like "change code while debugging", "look at array contents by hovering mouse over the array", more colours to distinguish easily and so on.

    Hope the above makes your decision EASY!!

    😊

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi

      I have not worked with vb6, but SAP has made it work with any development language that supports COM technology which it does. As far as i know there are no extra benefits when programming with SAP objects. But you must bear in mind the fact that you can not catch an error is a huge disadvantage when working in VB6. Also all the samples that come with SAP are in VB.net.

      Hope this helps 😊

  • Posted on Oct 23, 2006 at 09:56 AM

    ... and if you develop in .NET you can download and use

    the development and certification tools from SDN. Go

    under Business One SDK Tools and download B1DE / B1TE /

    B1 DI Event Service / etc

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      I see there is a B1 AddOn Wizard,

      which gave me some error on the addon identifier field.

      After trying some times it created a project with a class that inherits from B1AddOn and has an events management different that usually i did with vb6 addons.

      Can you tell me something more? Is it a good solution?

      Thank

      Paolo

  • Posted on Oct 23, 2006 at 02:19 PM

    The wizard is based on a set of best practices and will

    make your life easier. It has some nice features like:

    - automatic generation of metadata code

    - automatic generation of menus

    - automatic generation of forms

    - easier and listener-based event handling

    - automatic setup creation

    It works for VB.NET and C#. When you download it from SDN

    you get also the user documentation and the source code.

    Many SDNers are using it and are pretty happy with it.

    You can also read some discussion about it in:

    Reason for Using the B1DE and the Screenpainter?

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      I tryed a little bit.

      Seems that i can add listners only if the class name of the form begins with 'Form__'. Is that correct?

      How do i use DI in this scenario?

      Is there additional documentation or code samples?

      Thank

      Paolo

  • Posted on Oct 24, 2006 at 01:41 PM

    1Q.

    How do i add form through the wizard once the wizard has finished?

    A.

    If you want to add a system form in the pool of forms that

    can be handled, pls see this thread

    accessing-new-forms-with-b1de

    If you want to add new forms / menus / listeners after you

    have run the wizard you can by following these points:

    - right click on your project in the Solution Explorer

    - click "Add"

    - click "New Item ..."

    - select "C# B1 AddOn Component" to add a new form / menu

    - select "C# B1 AddOn Listener" to add a new listener in

    the menu / form class you have opened in VS.NET

    2Q.

    Do i need to manage event filters if i use listeners?

    A.

    No, this is automatically handled by the wizard.

    3Q.

    The init method of the B1Connections class has parameter 'AddOnIdStr'. If it is blank i runs succefully otherwise i receive 'AddOn identifier is not valid'. Why?

    A.

    This is the addon Id. You are free not to use it but if

    you use it you need to activate the license for it.

    4Q. In the OnShutDown should i put some clean up code?

    By default it is empty.

    A.

    Any listener there is empty - you need to add your own

    code. If you need to run some code when B1 dies you need

    to add this code there. The same is true for the other

    listeners.

    5Q.

    Class B1AddOn1_Db is always necessary?

    A.

    No, it is used only if you add new metadata objects i.e.

    if you add new user tables / user fields / user objects.

    If you don't add them the class is generated but it is

    empty and you can ignore it.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Gianluigi, sorry for so many questions.

      I've got others: 😉

      1.

      I didn'd find a way to add menu items once the project is created. the add component wizard dosn't have the right click feature.

      2.

      How do i attach forms to menus?

      Do i have to create one class for each menu item? that would not be to manageble.

      3.

      Same for the forms:

      i cannot have one class for each form item that i want to manage events.

      thank

      Paolo

  • Posted on Oct 25, 2006 at 10:37 AM

    Q.

    I didn'd find a way to add menu items once the project is created.

    A.

    Once the project is created, all the added menus are contained in an XML. If you

    want to add new menus you will have to edit and change this XML.

    Q.

    How do i attach forms to menus?

    A.

    You go on the second tab of the wizard - titled Menus - and right click on the menu

    you want to attach your form. You can attach an existing form (in XML format) or you

    can ask the wizard to generate automatically a form for you starting from an UDO

    definition and attach it to the menu.

    Q.

    Do i have to create one class for each menu item? that would not be to manageble.

    A.

    You don't create classes, the wizard will create them for you with all the listeners

    you specified. The wizard will create a class for each menu you have selected. The

    same is true for forms / items: tool creates one class for every form / item you want

    to manage. All the listeners for this form / item is part of the class created. You

    need to write only your functional code in these callbacks and the framework will take care of registering / routing / filtering events.

    If you don't like this way of structuring the code, you could change the code generation part in the wizard source code and regenerate an ad-hoc wizard for you.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      my mistake, is that i didn't create a menu during the creation project wizard.

      Now if i try to create a new project i always receive 'no records found' message after the connect to a company form. 😔

      To tell the truth what i dislike is that if i have an addon with lots of form i will i have many many files/classes.

      What i i'd like to, is to have a class that manage everything concerned to a specific form.

      It's a pity because i find Listeners very good mechanism to catch events.

      I'm sure i will use it to interact with system forms, but not with user forms.

      Thanks a lot

      Paolo

  • Posted on Oct 25, 2006 at 01:32 PM

    About "the no records found" have a look at this thread:

    no-records-found-when-using-b1de--2005-sp1-

    About user forms: the wizard tries to enforce a model

    driven development process in which you define your data

    and views are generated out of them. UDO is the key of

    all this.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Now i've created a class to my manage my user form.

      I did it in a 'standard' way, the project was created through the wizard and menu events are catched in 'b1wizardbase' way.

      I thought it was possible to use b1connection class in my 'standard' form also, but refering to the TheAppl object i receive a 'Object reference not set to an instance of an object' exception.

      if i put a breakpoint the exception change to 'Thread interrotto' exception.

      What's happening?

      help...

  • Posted on Oct 26, 2006 at 10:24 AM

    ???

    I don't know what is going on and it is difficult to guess

    anyway:

    B1Connections is a singleton object that is created by

    the framework. This object has two properties that can

    be used to reference the DI connection and the UI

    connection. For instance the UI connection can be

    accessed with B1Connections.theAppl.

    When your listener is called these properties can be used,

    actually the wizard itself generates code that use them

    like in this sample:

        public class Button__139__37 : B1Item {
            
            public Button__139__37() {
                FormType = "139";
                ItemUID = "37";
            }
            
            [B1Listener(BoEventTypes.et_CLICK, false)]
            public virtual void OnAfterClick(ItemEvent pVal) {
                bool ActionSuccess = pVal.ActionSuccess;
                Form form = B1Connections.theAppl.Forms.Item(pVal.FormUID);
                Item item = form.Items.Item("37");
                Button button = ((Button)(item.Specific));
                // ADD YOUR ACTION CODE HERE ...
            }
        }

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.