How to change the Memo field in Microsoft Office Small Business Accounting by using the Small Business Accounting Software Development Kit (SDK) (917038)



The information in this article applies to:

  • Microsoft Office Small Business Accounting 2006, when used with:
    • Microsoft Office Small Business Accounting 2006 Software Development Kit 1.2

INTRODUCTION

This article describes how to change the Memo field in Microsoft Office Small Business Accounting by using the Microsoft Office Small Business Accounting Software Development Kit (SDK).

MORE INFORMATION

In the Small Business Accounting user interface, there are many forms that contain a Memo field. Among the forms that contain this field are the following forms:
  • Purchase Order
  • Vendor Bill
  • Item Receipt
  • Quote
  • Sales Order
  • Invoice
The Memo field is accessed programmatically through the Small Business Accounting SDK. Any object that implements the "Microsoft.BusinessSolutions.SmallBusinessAccounting.IContract" interface has a property that is named InternalComments. InternalComments is the property that is used to obtain and to set the Memo field that is in the user interface.

The following code sample demonstrates how to retrieve a purchase order from the Northwind Traders company.

Note The Northwind Traders company is the sample product company that is supplied with Small Business Accounting.

After you open the Northwind Traders company, the following changes occur:
  • The value of the Memo field is set to this is our new memo value.
  • The purchase order is saved back to the database.
You can verify the new value that is in the Memo field by viewing the field in the purchase order in Small Business Accounting.
// This code contains hard-coded values that work in Northwind Traders.

ISmallBusinessInstance iSbi = // Enter code to initialize iSbi here.

IPurchaseOrder ipo = (IPurchaseOrder) GetDocumentByDisplay(iSbi.PurchaseOrders, "11");
ipo.InternalComments = "this is our new memo value";

ipo.Save();

static IDocument GetDocumentByDisplay(IBaseMasterView view, string displayNum)
{
	IDocument document = null;
	DataRow row = null;

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

		dv.RowFilter = String.Format("DocumentDisplayNumber='{0}'", displayNum);

		if (dv.Count > 0)
		{
			row = dv[0].Row;
		}
	}

	if (row != null)
	{
		document = (IDocument) view.GetByDataRow(row);
	}

	return document;
}

Modification Type:MajorLast Reviewed:4/24/2006
Keywords:kbMBSMigrate kbhowto KB917038 kbAudEndUser kbAudKnowledgeWorker