Sage 50 - Canadian Edition SDK

Hi there,


Reaching out to get more information about the Sage 50 SDK available for the Canadian Edition of the software. I've downloaded the SDK and was successful in getting it up and running in a test environment.


I quickly realized that the SDK, while very easy to use, contains only a small subset of functionality for a developing a large scale integration or import tool.


For example, Customer Ledger, the only fields available for update are the address related fields. Custom fields, and data found on other tabs are not included in the current 2016.2 SDK. This is likely true for other modules as well.


I've spent some time exploring the MySQL tables, along with the data-dictionary, and can piece together (to some degree) some of the important relationships, but as you know, its preferred to use a maintained SDK for CRUDs to ensure compatibility should the schema change in an upcoming release.

Is there a more indepth SDK available? Third Party, or released by Sage?

If not, what is the recommended means to programmatically update Sage? Combination of using the SDK to handle record creation, then supplement with direct-table updates?

Any help would be greatly appreciated. Thanks in advance.

Mike

  • 0

    Majestix said:
    Customer Ledger, the only fields available for update are the address related fields. Custom fields, and data found on other tabs are not included in the current 2016.2 SDK

    True, except for CurrencyCode and PriceList that come from the Options tab.  There doesn't appear to be a way to set a customer default tax code for a new customer.  Some of the tabs' data doesn't seem to have been expected to be used in processing sales from a third-party application / webstore.  So it would have to be added in a separate update, perhaps after the customer record has been created.

    I noticed that there no facility for adding a 'ship-to' address for instance.  It can be done directly by accessing the tables and incrementing tNxtPIDs, and there is a 'SetShipToAddressLine' but that seems to be at an invoice level. 

    Majestix said:
    its preferred to use a maintained SDK for CRUDs to ensure compatibility should the schema change in an upcoming release.

    The schema could change, but the changes are very seldom, and very few.  Usually they are to integrate a new feature or a new Sage product, with a few exceptions.  i.e. the next Sales Order and next Sales Quote are now separate fields where there was only one before the change. 

    Majestix said:
    Is there a more indepth SDK available? Third Party, or released by Sage?

    Not from Sage, as far as I know.  There are integration products available from a few suppliers - i.e. data import tools.  

    Majestix said:
    If not, what is the recommended means to programmatically update Sage? Combination of using the SDK to handle record creation, then supplement with direct-table updates?

    I don't know what Sage would recommend, since I've never paid for the SDK and asked.   But you could infer some of the methods (pun intended) from the c# sample.  There are VBA and C++ samples as well, they're small utilities that do one thing, while the c# / .NET sample illustrates a lot more things that you can do (most of the code is commented out in main, just uncomment to run).

    All that said, the evidence suggests that some developers are using some direct access - there's no payment API but there are third-party payment applications, for instance.

    Dev-ProgRef.PDF suggests that the developer will have to do SQL updates, since it discusses the use of wSDBTransBegin, wSDBTransCommit and wSDBTransRollback to ensure transactions are completed, especially if you intend to run in a multi-user environment.

    I hope that helps, please post back!

    P.S.  I do not work for Sage, so nothing I've written above is official!

  • 0 in reply to RandyW
    > I noticed that there no facility for adding a 'ship-to' address for instance.

    Not sure of what context, but when adding a invoice via the SDK, you can most certainly set the ShipTo address via code.

    Eg this:
    With ..
    If bolShiptoSame = False Then
    ' we have a differnt shipping address
    L = 1
    For Each AddressLine In ShipToAddess
    .SetShipToAddressLine(AddressLine.ToString, L)
    L = L + 1
    Next
    End If

    In above, my custom software has an array of shipto lines, and the SDK “.SetSthipToAddressLine” allows me to set the ship to address via code.

    So most information can be updated – but a few “holes” exist. Same goes for tax code - I set the tax code for each invoice line in code.

    .SetTaxCodeString(InvoiceDetail.m_TaxCode, L)
    .SetLineAccount(InvoiceDetail.m_LineAccount, L)
    .SetLineAmount(InvoiceDetail.m_Price, L)

    So for creating a invoice from code, I am well able to achieve the results with the SDK. The above code is a vb.net library I created, and it used from Office (ms-access) to create invoices in SAGE 50. It works rather well.

    Regards,
    Albert D. Kallal
    Edmonton, Alberta Canada
    [email protected]
  • 0 in reply to Albert D. Kallal
    Hi, Albert,

    Yes, it's possible to set most things in the invoice (ship-to address, tax codes, etc. All I meant was that, for instance, Sage 50 Quantum allows 99 additional shipping addresses to a customer record, but there's no facility in the SDK to create the additional addresses. When creating a customer master record the SDK can't set the default tax code.

    As the SDK appears to be more for invoicing system / POS integration, those systems can store those details and add them to the invoices as they're created, as your system will.
  • 0 in reply to RandyW
    An excellent point and I concur. This is much why I noted the “context” of the goal and what one is attempting to do via the SDK is important.

    I also at least did want to clear up that the SDK is up to the task of allowing developers to create invoices etc. from 3rd party software - this includes setting taxes in an invoice etc. However, as you point out those taxes, ship to etc. will thus COME from that driving software and not necessary allow one to utilize all existing attributes of a given customer and setup.

    I suppose like Outlook, or Word, it would be great if the sage accounting package was a COM object with all properties and methods exposed. Such a COM approach would eliminate the need for the SDK, and also likely ever having to by-pass the SDK and go directly to the MySQL database.

    All in all, I enjoyed learning + adopting the SDK. The only downside was the challenge to get up to speed and building the interface took significantly longer than expected to achieve my desired outcomes.

    At the end of the day, I am satisfied with the SDK, and for most practical purposes, it not practical to update the database directly. So right now, thumbs up for the SDK.

    Regards,
    Albert D. Kallal
    Edmonton, Alberta Canada
    [email protected]
  • 0 in reply to Albert D. Kallal
    Appreciate all your replies, very helpful.

    I'm wondering what the general census is for working outside of the SDK. As I've said, I've found the SDK to be limited - and feel we would have more flexibility talking directly to the database. But the trick is ensuring the MySQL database/process is up and running when I need it.

    I've learned over the last few days that the Connection Manager handles the creation/deletion of the mysqld process.. When using the SDK, "GetConnectionInfo" appears to make a connection to the Connection Manager, which then spawns the mysqld process...

    Without using the SDK, how do I make a connection to the Connection Manager to spawn the mysqld process?

    Is it recommended to use the SDK/GetConnectionInfo/OpenDatabase to ensure the server is spawned, then use the mysql SDK to talk to the MYSQL instance directly?

    Is there anything published showing the protocol/communication methods of the Connection Manager outside of the SDK?

    How does the .SAI file relate to the actual database residing on the server? The contents of the folder just show the "shared" file path... I'm assuming a reverse lookup of sorts is done on this path to identity the Share Server name?

    Any help you could provide would be great.

    Thank you.
    Mike.
  • 0 in reply to Majestix

    Majestix said:
    Without using the SDK, how do I make a connection to the Connection Manager to spawn the mysqld process?

    I believe the Connection Manager also checks for a valid license, and it's written by Sage.   So I would think that there is no way, outside the SDK.

    Majestix said:
    Is it recommended to use the SDK/GetConnectionInfo/OpenDatabase to ensure the server is spawned, then use the mysql SDK to talk to the MYSQL instance directly?

    That's how I would do it, except that instead of using code written for direct access into MySQL, I would use the data access utilities from c# code inside the SDK, as in the SDKExample  #region DatabaseUtilityExamples.  It would do basically the same thing, possibly using the same methods.

    There's another example in CPP that is a lot more 'down and dirty'. 

    Majestix said:
    Is there anything published showing the protocol/communication methods of the Connection Manager outside of the SDK?

    There's some CPP example code that uses COM to connect through the Connection Manager, other than running the supplied example, and poking in dev-progref.pdf a little, I haven't seen anything.   Short answer: I don't know.

    Majestix said:
    How does the .SAI file relate to the actual database residing on the server? The contents of the folder just show the "shared" file path... I'm assuming a reverse lookup of sorts is done on this path to identity the Share Server name?


    Yes.  I believe the 'real' path - i.e. the UNC path and filename for datafolder.sai is parsed to  \\servername\sharename\companyFolder\DataFolder.SAJ to find the tcp/ip address of the server, connect to the Connection Manager, and have it tell the MySQL daemon which data you want it to pass back a connection port for.

     

  • 0 in reply to Albert D. Kallal

    HI Albert, would you be willing to share your vb.net library for poking in invoices?

    Dave

  • 0 in reply to djyule

    You can contact me at the email in my sig.

    Such code is part of an application and is not code that I willing to share to the public.

    Regards,

    Albert D. Kallal
    Edmonton, Alberta Canada
    [email protected]