How to use the Small Business Accounting SDK to programmatically set up user-defined fields in the user interface in Small Business Accounting (923959)



The information in this article applies to:

  • 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

You can set up user-defined fields in the user interface in Microsoft Office Small Business Accounting. This article describes how to use the Small Business Accounting Software Development Kit (SDK) to programmatically set up user-defined fields.

MORE INFORMATION

You can use the Small Business Accounting SDK to programmatically set up user-defined fields in the user interface in Small Business Accounting. When you do this, you can name and then enable a user-defined field.

The following code sample sets up, names, and then enables a boolean field. The field is named "Is Vested."
// Retrieve user field setup object for employee accounts.
IUserFieldsSetup empFieldSetup = iSbi.UserFieldsSetup(AccountType.EmployeeAccount);
// Check whether Bool1 user field is already defined for this account type.
if (! empFieldSetup.Bool1Active)
{
	//Clear out any existing data.
	empFieldSetup.ClearFieldForType(typeof(Boolean), 1);
	// Add a field to indicate if the employee is vested for 401(k).
	empFieldSetup.Bool1Label = "Is Vested";
	empFieldSetup.Bool1Active = true;
	// Save user fields information.
	empFieldSetup.Save();
}

Modification Type:MajorLast Reviewed:8/17/2006
Keywords:kbExpertiseAdvanced kbMSCCSearch kbhowto KB923959 kbAudDeveloper