Microsoft KB Archive/908351

= How to delete line items and members of collections in Accounting Professional 2007, in Accounting Express 2007, or in Small Business Accounting 2006 =

Article ID: 908351

Article Last Modified on 2/8/2007

-

APPLIES TO


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

-





INTRODUCTION
This article describes how to delete line items and members of collections in Microsoft Office Accounting Professional 2007, in Microsoft Office Accounting Express 2007, and in Microsoft Office Small Business Accountingg 2006.

You can delete any .NET type that implements the Microsoft.BusinessSolutions.SmallBusinessAccounting.IBaseChildEntity interface by setting the IsDelete property to true and then calling the Save method of the root object.



MORE INFORMATION
Certain master entities in Accounting Professional 2007, in Accounting Express 2007, or in Small Business Accounting 2006 contain DataView properties that represent child entities. You can delete these child entities by setting the IsDelete property to true and then calling the Save method.

The ICustomerAccount master entity is an example. This master entity contains a collection of phone numbers in a property that is named CustomerVendorPhones (ICustomerVendorPhoneView). (The collection of phone numbers is the ICustomerVendorPhone property and the child entity.) The following sample code checks to see whether a business phone number exists. If a business phone number exists, the code deletes the number by setting the IsDelete property to true and then calling the ICustomerAccount.Save method. In the following sample code, the &quot;cust&quot; reference variable represents an instantiated ICustomerAccount object. if (cust.CustomerVendorPhones.DoesTypeExist((int) CustomerVendorPhoneType.Business)) {   ICustomerVendorPhone iCvp = cust.CustomerVendorPhones.GetByType(CustomerVendorPhoneType.Business); iCvp.IsDelete = true; cust.Save; }

Additional query words: Content Maintenance 45492, SBA, SDK

Keywords: kbhowto kbmbsmigrate KB908351

-

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

© Microsoft Corporation. All rights reserved.