Is there a .NET library available that lays on top of BOI COM implementation?

I recently took the BOI course on SageU and have been educating myself in how to use the BOI COM interface. I'm finding that there seems to be a real need for a .NET (or CLR) library that abstracts away the COM implementation so that we can just work with real .NET objects in our code. This is different from the DispatchObject which is just a generic wrapper around COM objects. I'm looking for first class .NET objects that represent the underlying COM objects and have Intellisense and manage references and memory under the hood. Does anyone know if there is such a library available?

Parents
  • Hi twc, I agree and have just started working on just what you are asking for... a library of wrapper classes and useful functions to make working with BOI in .NET a little easier. I will keep this forum posted with the progress. Open to suggestions too!

    Thanks
    Bret

  • in reply to Bret

    , I was wondering if you have any updates on how your library is coming? We're transitioning back to our project that could really benefit from a library like that. In our case, we'd be interested in incorporating it into a web service hosted in IIS that would act as an endpoint for our online store to hook back into Sage (ie. to replace our SData usage).

  • in reply to twc

    Hi twc,

    Its still in progress. The plan is to make the library available as a nuget package, either on nuget.org itself, or something we host ourselves, it hasn’t been decided yet.

    And I’m sorry that I don’t have an eta for this yet, but I will start pushing to get one and will keep you updated.

    Thanks!
    Bret

  • in reply to Bret

    ,

    Thanks for the update. I'd be happy to help wherever I can.

    Joel

  • in reply to Bret

    Hey Bret, been a few years. How has your progress gone for the library? I see there is a nuget package out there now, have you contributed to that or used it? 

  • in reply to wishingforsql

    Yes, if you are referring to the Sage100.ObjectManagement package. I have used it in a couple projects. It contains our latest version of the PvxDynamic class which is a dynamic wrapper for ProvideX based COM objects as well as various other wrappers for some of the more commonly used Sage 100 classes.

  • in reply to Bret

    Any chance of a sample sometime or some documentation? Glad to hear it's actively maintained / up to date. I'll start poking at it. 

Reply Children
  • in reply to wishingforsql

    The Sage100.ObjectManagement code is pretty well documented, and here is a real simple example of creating a customer and then deleting it.

    using Sage100.ObjectManagement;
    using Sage100.ObjectManagement.Interfaces;
    using System;
    using System.Net;
    
    namespace SageCityDemo
    {
        class Program
        {
            static void Main(string[] args)
            {
                var homePath = @"C:\Sage\Sage 100 Advanced\MAS90\Home";
                var userName = "test";
                var password = "pa$$word";
                var companyCode = "ABC";
    
                var sessionLogon = new SessionLogon
                {
                    CompanyCode = companyCode,
                    UserLogon = new NetworkCredential { UserName = userName, Password = password },
                    ModuleCode = ModuleNames.AccountsReceivable,
                    ModuleDate = DateTime.Today
                };
    
                using (var sySession = new MasSession(homePath))
                {
                    sySession.InitSession(sessionLogon);
    
                    using (var arCustomer = sySession.CreateObject<IMasBusinessObject>("AR_Customer_bus", "AR_Customer_ui", "A/R"))
                    {
                        arCustomer.SetKeyValue(AR.DivColumn, "01");
                        arCustomer.SetKeyValue(AR.CustomerColumn, "BOITEST");
                        arCustomer.SetKey();
    
                        arCustomer.SetValue("SalesPersonDivisionNo$", "01");
                        arCustomer.SetValue("SalesPersonNo$", "0100");
    
                        if (!arCustomer.Write()) { Console.WriteLine($"New customer not created. {arCustomer.LastErrorMessage}"); }
    
                        arCustomer.SetKeyValue(AR.DivColumn, "01");
                        arCustomer.SetKeyValue(AR.CustomerColumn, "BOITEST");
                        arCustomer.SetKey();
    
                        if (!arCustomer.Delete()) { Console.WriteLine($"The customer delete failed. {arCustomer.LastErrorMessage}"); }
                    }
                }
            }
        }
    }

    Thank you!

  • in reply to Bret

    Excellent thanks! I've been getting along with BOI, it's just very verbose in c#. I think I see enough of the intended implementation of the nuget to see the philosophy.  Is there any documentation for the nuget outside of the xml? I haven't found it.