In the Small Business Accounting 2006, Accounting Professional 2007, and Accounting Express 2007 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 2006 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 2006, in Accounting Professional 2007, and in Accounting Express 2007.
// 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;
}