Microsoft KB Archive/920197

= How to programmatically determine whether a Small Business Accounting item is taxable =

Article ID: 920197

Article Last Modified on 2/6/2007

-

APPLIES TO


 * Microsoft Office Small Business Accounting 2006 Software Development Kit 1.2
 * Microsoft Office Small Business Accounting 2006
 * Microsoft Office Small Business Management Edition 2006

-





Notice
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.



INTRODUCTION
You can determine whether an item in Microsoft Office Small Business Accounting is taxable by using the software development kit (SDK).



MORE INFORMATION
You can determine whether any Small Business Accounting type that implements the ITaxGroup interface is taxable. To do this, examine the value of the object’s AutoIncludeAllTaxCodes property.

The following code sample prints the value of the AutoIncludeAllTaxCodes property for an item in the Northwind Traders company. Northwind Traders is a fictitious company that is used for demonstration in Small Business Accounting. The code sample retrieves an item from the database and then prints the item’s name and the item's status as taxable or not taxable. // Declare the ISmallBusinessInstance iSbi variable. ISmallBusinessInstance iSbi;

// iSbi must be instantiated before continuing.

IInventoryItemAccount item = (IInventoryItemAccount) GetAccountByName(iSbi.ItemAccounts, &quot;Fishing Line&quot;); Console.WriteLine(&quot;\nItem Name:\t{0}\nTaxable:\t{1}\n&quot;, item.Name, item.ItemTaxGroup.AutoIncludeAllTaxCodes); Console.ReadLine;

static IAccount GetAccountByName(IBaseMasterView view, string acctName) {   IAccount account = null; DataRow row = null;

if (view != null) {       DataView dv = view.DataView;

dv.RowFilter = String.Format(&quot;Name='{0}'&quot;, acctName); dv.Sort = &quot;ModifiedDateTime DESC&quot;; // In case there is more than one row, we retrieve the latest one. if (dv.Count > 0) {           row = dv[0].Row; }   }

if (row != null) {       account = (IAccount) view.GetByDataRow(row); }

return account; }

Additional query words: IV SBA

Keywords: kbexpertiseadvanced kbhowto KB920197

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.