Guides (SDK /API)Technical ReferenceBBDNHow-to Documentation

You are here: Custom Parts Example: Pledge Form > Infinity Customization for Custom Pledge > Create a Table for the Custom Pledge Record

Create a Table for the Custom Pledge Record

Code sample project: Custom Pledge Form

  1. Right-click your CustomPledgeInfinity project in your PartsProjectExample solution and select AddNew Item. The Add New Item screen appears.

  2. Under Installed Templates, click Blackbaud AppFx Catalog.

  3. Select Table Spec.

  4. In Name, enter CustomPledgeRecord.Table.xml.

  5. Click Add. The Table Spec appears in an editor.

  6. Adjust the TableSpec attributes.

    <TableSpec 
    	xmlns="bb_appfx_table"
    	xmlns:common="bb_appfx_commontypes" 
    	ID="b8746f13-9fa6-44a1-aea7-6198d65eace7"
    	Name="CustomPledgeRecord"
    	Description="A custom pledge record to hold pledge information from a custom BBIS pledge form"
    	Author="Technical Training"
    	Tablename="USR_CUSTOMPLEDGERECORD"		   
    	>
  7. Add definitions for the fields on the table.

        <TextField Name="KEYNAME" Required="true" Description="Last name" Length="100"/>
        <TextField Name="FIRSTNAME" Required="true" Description="First name" Length="100"/>
        <TextField Name="MIDDLENAME" Required="false" Description="Middle name" Length="100"/>
        <ForeignKeyField Name="CONSTITUENTID" Required="false" Description="Foreign key to constituent record"  
                          ForeignTable="CONSTITUENT" ForeignFieldName="CONSTITUENTID"  />
        <EmailAddressField Name="EMAIL" Description="Email address"/>
        <CodeTableField CodeTable="USR_CUSTOMCLASSYEARCODE" Name="USR_CUSTOMCLASSYEARCODEID"
                    Required="false" Description="Custom class year code" />
        <CodeTableField CodeTable="ACADEMICYEARCODE" Name="ACADEMICYEARCODEID"
                        Required="false" Description="Academic year code" />
        <CodeTableField CodeTable="EDUCATIONALHISTORYLEVELCODE" Name="EDUCATIONALHISTORYLEVELCODEID" Required="false"
                        Description="Educational history code" />
        <MoneyField Name="AMOUNT" Description="Amount of pledge" Required="true"/>

The completed Table Spec should look like this:

<TableSpec 
	xmlns="bb_appfx_table"
	xmlns:common="bb_appfx_commontypes" 
	ID="b8746f13-9fa6-44a1-aea7-6198d65eace7"
	Name="CustomPledgeRecord"
	Description="A custom pledge record to hold pledge information from a custom BBIS pledge form"
	Author="Technical Training"
	Tablename="USR_CUSTOMPLEDGERECORD"		   
	>

	<!-- define fields on the table -->
	<Fields>
    <TextField Name="KEYNAME" Required="true" Description="Last name" Length="100"/>
    <TextField Name="FIRSTNAME" Required="true" Description="First name" Length="100"/>
    <TextField Name="MIDDLENAME" Required="false" Description="Middle name" Length="100"/>
    <ForeignKeyField Name="CONSTITUENTID" Required="false" Description="Foreign key to constituent record"  
                      ForeignTable="CONSTITUENT" ForeignFieldName="ID"  />
    <EmailAddressField Name="EMAIL" Description="Email address"/>
    <CodeTableField CodeTable="USR_CUSTOMCLASSYEARCODE" Name="USR_CUSTOMCLASSYEARCODEID"
                Required="false" Description="Custom class year code" />
   
    <CodeTableField CodeTable="EDUCATIONALHISTORYLEVELCODE" Name="EDUCATIONALHISTORYLEVELCODEID" Required="false"
                    Description="Educational history code" />
    <MoneyField Name="AMOUNT" Description="Amount of pledge" Required="true"/>
	</Fields>

</TableSpec>