Unable to Access/ Open Sample Company in Sage50

Dear Sage Support,

Good Morning,

Hope everyone is doing great,

I'm having hard time connecting my .NET Application via .NET SDK for Sage50 Accounting.

I have prepared an sample CONSOLE APPLICATION in order to test the authentication as per documentation provided "Sage 50 .NET API - Quick Start Guide.pdf".

See attached Image 1:[01-Initial-Connection.PNG]: As suggested  in documentation we can pass BLANK Application ID which will allow us to connect to Sage 50 Sample Companies.

But unfortunately, in my case it didn't happened.

I was getting this error: "Object reference not set to an instance of an object".

Can you please tell me where this are wrong ?

Question: Since I do own as verified Sage50 Accounting software, where do I get APPLICATION ID ?

How can I get APPLICATION ID ?

See attached Image 2:[02-Open-Company-Link.PNG]: I have tried the exact code as mentioned in attached image.

Please see below:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Sage.Peachtree.API;

namespace Sage50_OMS_ConsoleApp
{

    class Program
    {
        //The main session into the Sage 50 application;

        static void Main(string[] args)
        {
            try
            {
            PeachtreeSession apiSession = new PeachtreeSession();
            AuthorizationResult authResult = new AuthorizationResult();
                // The main session into the Sage 50 application;
                Company companyContext = null;

                // start the session.
                // with no application ID, you can only open Sample companies
                apiSession.Begin("");

                // Get CompanyIdentifer for sample company
                CompanyIdentifierList companyId_List = apiSession.CompanyList();
                CompanyIdentifier companyId = companyId_List.Find(
                    delegate (CompanyIdentifier o)
                    {
                        return o.CompanyName == "My Company Name";
                    });

                // Ask the Sage 50 application if this application has been granted access to the company.
                authResult = apiSession.VerifyAccess(companyId);

                // Check if the app has authorization before
                if (authResult == AuthorizationResult.Granted)
                {
                    // open the company
                    companyContext = apiSession.Open(companyId);
                }
            }

            catch (Exception ex)
            {
                Console.WriteLine(ex.Message.ToString()+Environment.NewLine+ex.InnerException);
            }

            Console.ReadLine();
        }
    }
}

See attached Image 3:[03-Sage-City-Link.PNG] 

Since I had no clue on how do I resolve this issue. As a result , I logged into Sage City & requesting for any help.

Kindly help me solve the issue as it is staggering my work in my project.

Please let me know if you require any extra information from my end.

Thanks & have a great day ahead.
- Ajay

  • 0

    Hello Ajay, we can investigate the issue further but it would require a subscription to our Development Partner Program. The current enrollment fee is $350 and the annual renewal is $250. If you would like to join, please email your contact details to [email protected] and we will start the application process. However, I can create a free .NET API ID for you. Please email to the same address quoting the name of your application and a future expiration date (if any). Thanks!

  • 0 in reply to SoumenS

    Appreciate your prompt response SoumenS.

    We are the development partner for our client who owns Sage50 Quantum Accounting Software (Desktop Version) with valid Customer ID.

    Do they still need to subscribe for Development Partner Program ? If Yes, I will talk to them & will get back to you accordingly.

    You also mentioned that you will be creating free .NET API ID for me with details such as:

    Name of your application: Question here:  Where do I get it from ? I has created simple Console Application in C# to test my connection to Sage50.

    Future Expiration(if any): Question here: Where do I get it from ?  I don't have it with me.

    Do let me know if you have any question/ concern.

    Thanks

    - Ajay

  • 0 in reply to Ajay Jamwal

    Hi Ajay, yes if you or the customer need help on the SDK/API issues, a DPP subscription would be necessary. You can provide any alpha-numeric text name for your application and any or no future expiration date. Thanks!

  • 0 in reply to SoumenS

    Soumen, we need to change this email address to another one. How can I do that? also, the customer has a support agreement. Does that mean we still require the development subscription? 

    if so, how do we go about getting the subscription? 

    Please note that we do need to change this email to my corporate address, please advise how. 

  • 0 in reply to Ajay Jamwal

    Hi Ajay, if you need to change your contact details, please email the new information with your account # to [email protected] and I will update the records. The end user product support plans do not cover SDK/API issues. Please email your consent to the same address and I will setup a representative to contact you for the application and payment. Thanks!

  • 0 in reply to SoumenS

    ok. i will do so. 

    Can you point me to the exact URL where we can get the developer subscription? While looking through the developer site, I could not see any areas to get the subscription for the on-prem version that we use.  Can you point us in the right direction to get things going? 

    It's absolutely ridiculous that after being on hold for over 2 hours multiple times by now, there was no one on the support line even after having a support contract in place. 

    I just hope that is not how your developer support works!

  • 0 in reply to Ajay Jamwal

    also, please note that we are talking about the 'onprem' version here, not the cloud version. We are trying to do some integration with our own ERP. I want to ensure that you understand this clearly.