Skip to content
logo Knowledgebase

Sage 200 SDK - Common Queries and Frequently Asked Questions

Created on  | Last modified on 

Summary

The SDK provides access to the Sage 200 Business Objects along with many tools and content which will assist you in developing integrating applications, or customisations to the Sage 200 desktop. The following FAQs relate to Sage 200 Professional. For further information, detailed code examples and guides please visit the software development help documentation.

Description

Contents:
Setup and configuration

Q. Where can I get support with installing the Sage 200 program?

A. All setup and installation queries relating to the Sage 200 program must first be raised with your relevant support provider, be that Sage or your Accredited Business Partner. Sage 200 Technical Support can then assist with escalated queries regarding setup and configuration whilst Sage Developer Services can assist with any integration specific queries regarding the software development kit.

We have documented the process for raising a ticket with technical support here.

Q. What is the Sage 200 Software Development Kit (SDK)?

A. The Software Development Kit (SDK) is a comprehensive set of components that allow you to customise Sage 200, in terms of the user interface and functionality, and seamlessly integrate your own applications. The Sage 200 SDK provides all of the libraries, tools, documentation and samples you will need to get the most out of Sage 200.

Q. Who should be using Software Development Kit (SDK)?

A. The Sage 200 SDK is for those members of the Developers Programme who want to customise Sage 200 Professional with additional functionality to suit the requirements of specific clients or markets. This can take the form of anything from small screen changes or feature amendments, to large scale applications that utilize the Sage 200 database such as web applications.

Q. What are the benefits of using the Software Development Kit (SDK)?

A. The components in the Sage 200 SDK are the building blocks of Sage 200 itself. The libraries themselves contain all the business rules and processes that make up Sage 200. Using these alone means you can be confident that the integrity of your data is maintained. Other tools such as Sage Object Store Builder allow you to link your own database tables to the Sage 200 database, while the Sage Report Designer lets you create your own reports. With the Sage Form Designer, you can quickly add controls to Sage 200 screens that display data stored in your own tables.

Most importantly documentation and support from Sage also means that you can develop your own applications with the same Sage 200 look and feel.

Q. How do I get access to the Sage 200 Software Development Kit (SDK)?

A. The SDK requires an active subscription to the Sage Developers Program. If you are interested in becoming a member of the programme please use our interest form here, this will be sent to our enablement team who will get back to you with further information.

Alternatively, we have a free to access RESTful web API; additional information can be found here.

Q. How can I download the Software Development Kit (SDK)?

A. As a member of the programme you can download the most recent development kit from our download portal along with older versions if required. From here you can also access the latest assemblies and our help documentation which contains detailed examples for using the 200 business objects.

Q. How can I access demonstration data?

A. Demonstration data will insert information into your system to be used for development and testing purposes. You can download a backup containing the Sage 200 Professional demonstration data from our download portal or from the Business Partner product downloads portal within the additional content section of the Sage 200 product.

Q. How do I setup the connection from my external application?

A. Our help documentation details connection and getting started. There is a specific sections on References and Debugging and using the Assembly Resolver which we have linked below.

CAUTION: When developing your application please ensure that the connection process detailed in the Sage 200 SDK Help Files is followed.

The most important SDK connection change within recent versions is that the assemblies are not installed into the GAC, therefore you are required to use the assembly resolver as per the help document linked above and to ensure you using the FindCore200() method in the entry point of your application. This will then check the registry for the correct install location, and then resolve the correct assemblies.

Sage 200 Professional now uses a Click Once installer and is no longer installed to the Program Files, this means the assembly resolver code mentioned above is necessary.

We also have an external application example on our GitHub which includes this.

Please also ensure you have referenced the correct version of assemblies which match the version of Sage 200 you are developing against and that the assemblies copy local property is set to false.

Q. I am new to the SDK, where do I learn the basics?

A. Our development basics article will guide you through the connection to a Sage 200 company using the Software Development Kit by an external application.

It also covers Sage 200's most popular modules from customers to cash book, providing a very high-level description alongside code examples for creating and amending some of these items. This is intended for developers who are beginning their journey with Sage 200 development and would like to learn the basics.

Q. Where can I find example solutions?

A. Our GitHub portal is the location for open source solutions and contains full examples of our common processes using our integration methods. We are continually growing and improving the examples available and are always looking for ideas and code contributions from the developer community.

Q: When should I user a web user

A: The web user role is very limited with functionality and was only created for accessing workspaces, web timesheets/ expenses and authorising purchase orders.

This is detailed within our help documentation linked here. For anything else you would be required to use a full license.

Integration Queries 

Q. How do I create a web service?

A. Our help documentation provides detailed walkthroughs and examples for hosting a web service, see here. We also provide a comprehensive web service example downloadable on our GitHub, see here.

These our community-maintained solutions and rely on developer contributions to keep updated. These are not supported by the Developer Services team.

Customisation Queries 

Q. Is there a guide for understanding the Sage 200 databases?

A. Our latest document which covers the structure of the Sage 200 database tables was created in 2015 and can be found here. The core structure elements have not fundamentally changed and are still valid.

Q. How can I check database differences between versions?

A. To check for database differences we suggest restoring a copy of the two databases you wish to compare into SQL Management Studios and run the script detailed in the following article. This will output database table, column and relationship differences.

Q. How do I handle multiple data models on the same company?

A. If you are developing an extension which will extend a table, you will encounter issues when one already exists and will cause a customisation to fail.

In this scenario you will need to use the Data Model Builder, which comes as part of the SDK tools and allows you to notify the addon that the table has already been extended. You can do this by choosing the configure tables option and then selecting the checkbox for the table already extended.

NOTE: By creating your addon in this way it will always rely on the table already existing and will break otherwise. As this is the case it is a good idea to create 2 addons, one which utilises the normal method of creating the table and one which uses the suggested method above.

Q: How do I suppress the user interaction element when exporting

A: It is possible to suppress the print dialog by passing the ‘SuppressUserInteraction’ and ‘UseDefaultPrinter’ ExportFlags into the exporter also ensuring to set the printer name you require as shown within the code example below.

Please also keep in mind is that you are required to set all criteria on the report / layout to ensure no dialog pops.

//Suppress user interaction with printer dialog  

Sage.Reporting.Engine.Integration.ExportFlags flags = Sage.Reporting.Engine.Integration.ExportFlags.None; 

flags = Sage.Reporting.Engine.Integration.ExportFlags.SuppressUserInteraction | 
Sage.Reporting.Engine.Integration.ExportFlags.UseDefaultPrinter; 
Type exporterType = exporter.GetType(); 

System.Reflection.PropertyInfo reportsPropertyInfo = exporterType.GetProperty("Reports", System.Reflection.BindingFlags.Public | 
System.Reflection.BindingFlags.Instance); 

var reports = reportsPropertyInfo.GetValue(exporter, null); 

var batchItem = ((System.Collections.IList)reports)[0]; 

var reportPropertyInfo = batchItem.GetType().GetProperty("Report"); 

Sage.Reporting.Model.IReport report = reportPropertyInfo.GetValue(batchItem, null) as Sage.Reporting.Model.IReport; 

System.Drawing.Printing.PrinterSettings printerSettings = report.PaperLayout.PrinterSettings; 

printerSettings.PrinterName = "PrinterName"; 

exporter.Run(Sage.Reporting.Engine.Integration.ExportType.prn, 

@"C:\test.prn", flags); 

Q: How do I suppress the print dialog when using the Sage.Accounting.Reporting.Report object

A: This is currently not possible on this object. We do have a Request For Change (Known Issue 3592) currently logged for this, requesting that the “SuppressUserInteraction” property is exposed on the Report object. An example of how this can be achieved can be found here on our new Developer Community page.

Q: Can I modify Instrument Objects?

A: No. Instruments are transient objects responsible for handling multiple Persistent Objects and therefore are not accessible to modify.


As an example looking at the SalesInvoiceInstrument, when you call Update() on this instrument, it makes several postings (to the Sales Ledger, Nominal Ledger, Tax Module etc).
Due to this making several postings to different areas of the program, there is no way of determining how an additional field of an instrument object maps to additional fields on Persistent Objects.


You can amend Persistent Objects through the ObjectStore builder that comes with the SDK. Our help files have an example of how to use the ObjectStore builder which can be found here.

Common Exceptions 

Q. Please check if the Sage200Configuration database is configured and running.

A. There are a few steps which need to be taken when connecting to Sage 200 through the Software Development Kit and if incorrect, this exception can occur.

First, reference the relevant Sage 200 assemblies within your solution, this document covers the minimum for each module. You can get the assemblies you require from our download page or the Sage 200 client installation folder.

The assemblies used must match the version of Sage 200 you are developing against and have their copy local properties set to false.

Within your main method call the assembly resolver code. After the assemblies have been resolved, call your connection method. You can also access our GitHub to find helpful solutions including our C# connection example applications. This solution contains everything required for connecting but you will need to change out the Sage assemblies to your local copies.

Q. The version of Sage 200 is older than that of the database for the selected company.

A. This message states that the version of your data for the selected company varies from the installed version of Sage 200. The first step is to ensure the assemblies referenced within your application match the version of Sage 200 you are developing against; you can get the correct version of assemblies from your client install location.

If this is not the case, update your company database within Sage 200 System Administration to ensure it is the correct version for your version of Sage 200.

If the issue remains, create a new company, adding a clean set of demo data matching your versions; you can download demo data from our download portal.

If the exception continues download the latest version of the external application example provided on our GitHub. This provides the correct code for use of the connection code and assembly resolver method and eliminates any issues with retrieving the correct assemblies.

Q. Failed to install Add-on: Model aggregation process failed while loading source for '' model., Model aggregation process failed while loading source for '' model.

A. In the error message there should be a model name shown in the single quotes: " Model aggregation process failed while loading source for '' model., Model aggregation process failed while loading source for '' model. ".

It may be that the Model Name is now blank instead of saying "Sage 200 Accounts". You can usually check this by looking at C:\inetpub\Sage 200 App Services\Sage200SecuredServices\Models folder. It should contain only a folder named Sage 200 Accounts, and in this folder should be a folder for each installed model, including the 2 default models for Sage 200 Account and Bill of Materials. If the SDBX is showing the model name as blank, you should rebuild it, ensuring the Model Name is "Sage 200 Accounts", and then reinstall it.

If this folder is missing or does not contain the default models you will need to rebuild the data model. Start by uninstalling any SDBX packages which contain data models, ensure that you open the Sage Desktop after each uninstall, as this will force the data model to be reinstalled.

Help and further support 

Q. How can I suggest improvements?

A. We continuously update this article with further content and information. We would love your suggestions on how this article can be improved. Please provide any improvements for this article or for the developer programme on the submit an idea form.

You can also suggest and vote on ideas for improving the Software Development Kit or Sage 200 program on our Sage 200 Ideas Portal.