SDK Getting Started

SOLVED

I am a senior developer who is VERY new to Sage. I haven't ever used it or even seen it. A client wants me to use the SDK to get some very basic invoice and payment information out of Sage 50, but even the "Getting Started" info around here seems a little overwhelming. I only just started reading what's already on the forums and blogs here, but if someone can point me directly to a good how-to tutorial without all the accounting-speak, it would sure save me some time and money. Thanks in advance.

  • 0
    verified answer

    Hey Chris,

    Well the first question you need to answer is which SDK you are planning on using. I'm mostly familiar with the .NET SDK, but if you truly ONLY need read access, maybe you could use the OLEDB/ODBC (AKA Database) SDK. The OLEDB/ODBC SDK actually has the most access of any of the SDK's if you only need to read data.

    Being a senior developer, I suspect you're familiar with retrieving data from a database using ODBC (or you could probably talk directly using a Pervasive library). So you could probably get the ball rolling pretty quickly.

    If you want to use the .NET SDK, then I think the combination of the the Basic SDK App (should be installed under My Documents\Sage\Sage 50 SDK\.Net Samples\) along with the  Quick Start PDF (in the same directory) should get the ball rolling.

    There's 2 basic steps you must do to start communicating with Sage: create a new Peachtree session, and open a specific company (pages 9-12 of the Quick Start PDF).

    Reading data is mostly done through "Factories" built in to the Sage .NET Library you'll include in your project. So, a simple lame example, I want to get a list of all the sales tax codes set up for the company...

    (myPTCompany variable below is the company I mentioned you need to open above)

    SalesTaxCodeList salesTaxList = myPTCompany.Factories.SalesTaxCodeFactory.List();

    salesTaxList.Load();

    foreach (SalesTaxCode theCode in salesTaxList)

    {

       log.WriteLog(theCode.Description);

    }

    The very first time your app tries to access the Sage company, a warning message will pop up in Sage 50 asking for permission (I generally have to restart Sage 50 in order for this message to appear). Once you're granted access you don't need to do this step, until you change and recompile your program or DLL.

    I believe you'll need an official key from Sage before you can connect to legitimate Sage 50 Companies (you pass this key when you create the session initially) but without a key you can connect to the dummy/sample companies that are included in a Sage 50 install.

    If using the Sage .NET Libraries, the libraries are tied to the specific client year in Sage. It makes things harder for smaller developers. I have 3 separate projects for the same DLL, each one using a specific Sage DLL (we support Sage 2013, 2014 and 2015).

    That's roughly everything I wished I knew the first day I dove in to the SDK.

  • 0 in reply to fuerstma

    I'm also having difficulty getting started. I tried both the COM SDK (which requires a username and password) and the .NET SDK (which requires an Application ID). I have been round-and-round with tech support and have gotten nowhere fast. They want me to complete a developer application, which requires Silver or Gold membership. I cannot and will not pay the money these memberships require. I've seen documentation that there is a "Complementary" level of membership, but have no clue how to get such membership. Any suggestions on how to get started?

    Also, I've looked for an ODBC driver for Sage 50 2014, but have not found such an animal.

  • 0 in reply to Kenny Acock

    Hello Kenny,

    You don't need to have any type of membership in order to fill out the form. Once you've completed it you will be contacted by Sage with the credentials for both API's. Included in the SDK download is sample code that will help you to get up and running. 

    Additionally, instructions for creating an ODBC connection to Sage50 can be found here.

  • 0 in reply to wood

    The ODBC instructions you linked to was enough to get me going. Thanks!

  • 0 in reply to fuerstma
    Hi @fuerstma

    I have downloaded the Sage50 2015.3 SDK the website and used to evaluate how the SDK works. When we run the Sample Program provided in the SDK in a PC that has Sage 50 Accountant Edition 2015 Build: 22.3.00.0248 it works fine without any issue. But it is not working when we run the Sample Program in a PC that has Sage 50 Accountant Edition 2015 Build: 22.0.00.0106. It throws the error as "Could not load file or assembly 'Sage.Peachtree.API, Version=2015.3.0.248, Culture=neutral, PublicKeyToken=d06c16dde04d83e4' or one of its dependencies. The system cannot find the file specified."

    If there is different release and build in 2015 of Sage, is that necessary to use only the corresponding SDK? Or else is there any version of SDK i can refer so that it will work for all editions and versions of Sage2015.

    Thanks and Regards
    Venkatesan