Sage 50 SDK Canadian Edition

is there any complete example about how to create or update a customer and assign the Tax. as it seems to not be possible with the sdk and only with a direct access to Sage 50 Mysql Database

Thanks

Parents
  • 0

    Hi,

    There's no reference in the dotnet help for tax properties in the customer ledger class. 

    As you say, using the SDK to directly query and update the table as in this snip from the sample looks to me, to be the only way to do it.  Anyone else?

    // Example of non query

    // Update all record to "Canada" in vendor table

    int ret = util.RunNonQuery("UPDATE tVendor SET sCountry = 'Canada'");

    Console.WriteLine("RunNonQuery(\"UPDATE tVendor SET sCountry = 'Canada'\"): " + ret + "records affected");

    Console.WriteLine();

     

Reply
  • 0

    Hi,

    There's no reference in the dotnet help for tax properties in the customer ledger class. 

    As you say, using the SDK to directly query and update the table as in this snip from the sample looks to me, to be the only way to do it.  Anyone else?

    // Example of non query

    // Update all record to "Canada" in vendor table

    int ret = util.RunNonQuery("UPDATE tVendor SET sCountry = 'Canada'");

    Console.WriteLine("RunNonQuery(\"UPDATE tVendor SET sCountry = 'Canada'\"): " + ret + "records affected");

    Console.WriteLine();

     

Children
  • 0 in reply to RandyW

    what kind of language is this?? wow this is so confusing :)

  • 0 in reply to LaChapa

    LaChapa, it's C#.

    I personally don't use the SDK but Randy's SQL looks good (though I think you need an extra space before "records affected" for clarity ;).  When I did look at the specs of the SDK a few years ago, I never looked close enough to see what was available in customer ledger setup but I know not all functionality we need was part of the SDK at that time.  They only seem to expose what is on the Address tab for the most part in the ARAPLedgerBase Class in the current SDK.

  • 0 in reply to Richard S. Ridings

     It's a snip from the c# sample that comes with the SDK.  

    I can take no responsibility for the quality of the code, good or bad.

  • 0 in reply to RandyW

    I wonder use the SDK to run queries or connect directely to the Mysql Database and do it with a SQL that most of developer would understand..And beside the example provided with the SDK there is not much example on the internet.. does anyway knows a place full of examples?

    thanks to all lads

  • 0 in reply to Patrick Vidal

    Patrick

    Normally it only matters what you understand, not what most developers understand.

    You will not find much on the internet about programming for Sage 50 data.  The company does not promote a very good developer community even though we have tried to get them to do so.  While some developers do share information and some hire others to write SQL statements, rarely does that sharing come down to actual code because some write code in VB, some in VBA and others code in C# or even C++ in the older days.

    The ultimate methods you use to gain access to the data will be what you need for your solution.  There are lots of examples of programming on the internet.  Break down what you are doing into parts and look for the information you don't have.  Do not focus so much on the fact that it is Sage 50 and MySQL.  Focus more on the concepts of what you are trying to do.  There are many namespaces with methods you can use in the SDK.  It is supposed to shelter you somewhat from knowing exactly where all the data is.  But when you need to get right down to the SQL Randy indicated, you should be able to do that either with the SDK or without.

    Either with the SQL statements that Randy has indicated are in the SDK (and others) or you are filling a datatable from a MySQLDataReader of your own will get you to your solution.  You just have to do a lot more data validation if you are writing to the file outside the SDK from what I understand.  It can go wrong real fast if you are not very careful with your testing and validation.

    Hope this helps

  • 0 in reply to Patrick Vidal

    Patrick Vidal said:
    does anyway knows a place full of examples

    I'm afraid that this forum, and the sample files are about it.

    As Richard (who has been at this longer than I) said, Sage used to have really awful developer support, which has gradually improved.  

    Some competitors have offered better, richer SDKs for much longer, and now have a rich variety of competing third party products.  Sage 50 is virtually an empty field by comparison, so if you have a good application, there is a large captive market.

    While creating users and other 'ledger' tasks are fairly straightforward, I wouldn't create transactions outside of the import functionality, or the SDK.   There are too many moving parts (foreign currency, departments, projects, taxes, inventory item tax rules, etc.)

  • 0 in reply to RandyW

    Thanks Guys,

    That really answer my question.