Page 1 of 1

Adding Custom Fields

Posted: Mon Jul 26, 2010 12:58 pm
by rhuffman
In Able 5.x we added numerous custom field to our tables and were able to access them in the admin forms and display the changes in the aspx pages on the web.

I added two fields in ac_Categories table and need to add several custom fields throughout various tables. Specifically, we are adding one fild called "TitleTag" and need to add more.

I reviewed both the editCategory.aspx and the editCategory.aspx.cs files and made the appropriate changes base on how other fileds were being called.
However, once I attmepted to display the page we received an error:

c:\AbleCommerce\Admin\Catalog\EditCategory.aspx.cs(153,19): error CS0117: 'CommerceBuilder.Catalog.Category' does not contain a definition for 'TitleTag'

How can we complete this process, we need to add numerous custom fields to various tables.

following is the code we added:

EditCategory.aspx.cs (both were added in the appropriate sections)
TitleTag.Text = _Category.TitleTag;
_Category.TitleTag = TitleTag.Text;

EditCategory.aspx
<tr>
<th width="15%" class="rowHeader">
<cb:ToolTipLabel ID="TitleTagLabel" runat="server" Text="TitleTag:" ToolTip="Enter Title Tage to be displayed in on top of page Max 66 characters"></cb:ToolTipLabel>
</th>


<td>
<asp:TextBox ID="TitleTag" runat="server" Text="" Columns="40" MaxLength="100"></asp:TextBox>
<asp:RequiredFieldValidator ID="TitleTagValidator" runat="server" Text="*" Display="Dynamic" ErrorMessage="Name is required." ControlToValidate="TitleTag"></asp:RequiredFieldValidator>
</td>

</tr>

Re: Adding Custom Fields

Posted: Tue Jul 27, 2010 5:33 am
by mazhar
AbleCommerce 7 has a table named ac_CustomFields. Read the following post about to utilize this table to create custom fields without modifying schema.
viewtopic.php?f=42&t=8651