Adding User-Defined Fields (UDFs) to Forms

 

Expand/Collapse all Show/Hide All

The following table lists the templates with forms and the tables that are updated as part of the submission process.

Table

Template with Form

SO_ShipToAddress

ship_to.htm

IT_ShoppingCartItemsSelected

Products_nt2_single.htm

Products_nt2_single2.htm

Products_nt2_multi.htm

Products_nt2_multi2.htm

Products_no_tree.htm

Products_dtl_form2.htm

Products_dtl.htm

SC_STEP1.HTM

Submit_So.htm

AddItems.htm

IT_ShoppingCartHeader

SC_STEP2.HTM

SC_STEP2_NO_SHOP.HTM

submit_so.htm

IT_ShoppingCartDetail

SC_Step1.htm

Submit_So.htm

IT_UIDCustomerChange

Customer.htm

Profile.htm

Uid.htm

When you add a UDF to a form, only the column name is used for the form object name, but the column name and table name are needed in the token to set the initial value.  For example:

<input type="text" name="MyUDF" value="~~IT_ ShoppingCartItemsSelected.MyUDF$~~" size="31" maxlength="30">

For more information about using UDFs for form submissions, refer to the following sections:

Expand or collapse item  Requiring a User to Set a Value

To require the user to include a value in the UDF field, add id=”required” to the object. For example:

<input type="text" name="MyUDF" value="~~IT_ ShoppingCartItemsSelected.MyUDF$~~" id="required" size="31" maxlength="30" >

 

Expand or collapse item  Setting Check Boxes

When check boxes are included on a form, the check boxes contain the value “on” or null when submitted. The form submission translates this to either Y or N. Therefore, only yes / no columns should be set up as check boxes. To display a check box as selected, use the following to set the initial value to selected:

<input type="checkbox" name="MyCheckBox" ~~TBL(POS(MyTable.MyCheckBox$="Y"),"","checked")?x~~>

 

Expand or collapse item  Setting Drop Boxes

If you have specific values you want a user to use when setting a value, preset those available values in a drop box. As with the expression used to properly display the check box value, you must include an expression to set the drop box value.  An example of a drop box is:

<select name="Size">

<option value="S" ~~TBL(POS(MyTable.Size$=”S”),"","selected")?x~~>Small

<option value="M" ~~TBL(POS(MyTable.Size$=”M”),"","selected")?x~~>Medium

<option value="L" ~~TBL(POS(MyTable.Size$=”L”),"","selected")?x~~>Large

<option value="XL" ~~TBL(POS(MyTable.Size$=”XL”),"","selected")?x~~>Extra Large

</select>

 

Expand or collapse item  Adding Remarks

If the UDF applies to only a specific item type or product line, include an expression to include HTML remarks around the selection.  For example, using the drop box example above:

~~TBL(POS(CI_Item.ProductLine$=”SHOE”)),"<!--","")?x?a~~

<select name="Size">

<option value="S" ~~TBL(POS(MyTable.Color$=”S”),"","selected")?x~~>Small

<option value="M" ~~TBL(POS(MyTable.Color $=”M”),"","selected")?x~~>Medium

<option value="L" ~~TBL(POS(MyTable.Color $=”L”),"","selected")?x~~>Large

<option value="XL" ~~TBL(POS(MyTable.Color $=”XL”),"","selected")?x~~>Extra Large

</select>

~~TBL(POS(CI_Item.ProductLine$=”SHOE”)),"","")?x?a~~

The ?a portion of the token is necessary so that the HTML markup will be not be translated and include as markup.

 

Expand or collapse item  Using JavaScripts

You can use JavaScripts, included in Common.js and CreditCard.js, to perform client side validation and formatting of values submitted. In addition to allowing you to set a field on a form as noted above, these scripts allow you to make sure a beginning number is less than an ending number, format a phone number, verify an email address is submitted using the proper syntax, and more. For more information, see Using eBusiness Manager JavaScripts.

 

Expand or collapse item  Examples for Adding UDFs

These examples show different HTML markups you can use to add UDFs to various templates.

Expand or collapse item  Example - Adding a UDF for an Item

You want to add a My Item or Items Selected field to the products and services and the shopping cart Web pages to display the following information:

  • If the item is not added to the shopping cart, the value assigned to the item in Item Maintenance (CI_Item UDF)

  • If the item is added to the shopping cart, the value assigned to the item's selected column (IT_ShoppingCartItemsSelected UDF)

Use the appropriate HTML markup to add the My Item or Items Selected UDF to the following templates:

 

Expand or collapse item  Products and Services Main

Add the following HTML markup to this template:

Note You must use the row~~row~~ token to identify each item included on the page.

<td class="PSTitle" valign="bottom" colspan="2" align="right">My Item or Items Selected Column:</td>

<td class="PSData" valign="bottom" colspan="2" align="left">&nbsp;&nbsp;&nbsp;<input type="text" name="row~~row~~.UDF_IT_Selected" value="~~TBL(NOT(NUL(IT_ShoppingCartItemsSelected.UDF_IT_Selected$)),CI_Item.UDF_Item$,IT_ShoppingCartItemsSelected.UDF_IT_Selected$)?x~~" size="31" maxlength="30"></td>

~~%TemplateSvc'RowBreak$?a~~

 

Expand or collapse item  Products and Services Inquiry

Add the following HTML markup to this template:

Note You must use the row~~row~~ token to identify each item included on the page.

Note The first line adds the row title.

<tr><th class="IntRow" align="right" valign="top" width="30%">My Item or Items Selected Column:</th>

<td class="DataRow" colspan="2" valign="top" width="70%"><input type="text" name="row1.UDF_IT_Selected"  value="~~TBL(NOT(NUL(IT_ShoppingCartItemsSelected.UDF_IT_Selected$)),CI_Item.UDF_Item$,IT_ShoppingCartItemsSelected.UDF_IT_Selected$)?x~~" size="31" maxlength="30"></td></tr>

 

Expand or collapse item  View .order Shopping Cart

Add the following HTML markup to this template:

Note The first line adds the column title, and it must be added before the dynamically filled table.

<th class="IntRevRow" >My IT Shopping Cart Detail Column</th>

<td class="~~RowStyle$~~" valign="top"><input type="text" name="row~~row~~.UDF_IT_Cart_Detail" value="~~IT_ShoppingCartDetail.UDF_IT_Cart_Detail$~~" size="31" maxlength="30"></td>

 

Expand or collapse item  Confirm .order Shopping Cart

Add the following HTML markup to this template:

Note The first line adds the column title, and it must be added before the dynamically filled table.

<th class="IntRevRow" >My IT Shopping Cart Detail Column</th>

<td valign="top" class=~~RowStyle$~~ valign="top">~~IT_ShoppingCartDetail.UDF_IT_Cart_Detail$~~</td>

 

Expand or collapse item  .store Shopping Cart Step 1

Add the following HTML markup to this template:

Note The first line adds the column title, and it must be added before the dynamically filled table.

<th class="IntRevRow" >My IT Items Selected Column</th>

<td class="~~RowStyle$~~" valign="top"><input type="text" name="row~~row~~.UDF_IT_Selected" value="~~IT_ShoppingCartItemsSelected.UDF_IT_Selected$~~" size="31" maxlength="30"></td>

 

Expand or collapse item  .store Shopping Cart Step 3

Add the following HTML markup to this template:

Note The first line adds the column title, and it must be added before the dynamically filled table.

<th class="IntRevRow" >My IT Shopping Cart Detail Column</th>

<td valign="top" class=~~RowStyle$~~ valign="top">~~IT_ShoppingCartDetail.UDF_IT_Cart_Detail$~~</td>

 

 

Expand or collapse item Example - Adding Mapped Customer and Shopping Cart Header UDFs

You want to add a My Customer field to the customer Web pages, and a My Shopping Cart field to the shopping cart Web pages to display the following information:

  • If the customer did not submit the shopping cart, the value assigned to the customer in User Profile or Customer Maintenance (AR_Customer UDF)

  • If the customer submitted the shopping cart, the value assigned to the customer's shopping cart (IT_ShoppingCartHeader UDF)

Note You can also add the UDFs to the Customer Maintenance and Sales Order Entry tasks to view or edit the information when you process the customer’s order.

Use the appropriate HTML markup to add the My Customer or the My Shopping Cart UDF to the following templates:

 

Expand or collapse item  .store User Profile

Add the following HTML markup to this template:

Note The first line adds the row title.

<tr><th class="IntRow" align="right">My Customer Column:</th>

<td class="DataRow"><input type="text" name="UDF_UID_Customer_Change" value="~~AR_Customer.UDF_Customer$~~" size="51" maxlength="50"></td></tr>

 

Expand or collapse item  .store SC Step 2

Because the shopping cart value is available only after this page is submitted, an expression is used to display the customer value if the shopping cart value is not available. Add the following HTML markup to this template:

Note The first line adds the row title.

<tr><th class="IntRow" align="right">My Shopping Cart Header Column:</th>

<td class="DataRow" colspan="3"><input type="text" name="UDF_Cart_Header" value="~~TBL(NOT(NUL(IT_ShoppingCartHeader.UDF_Cart_Header$)),AR_Customer.UDF_Customer$,IT_ShoppingCartHeader.UDF_Cart_Header$)?x~~" size="51" maxlength="50"></td></tr>

 

Expand or collapse item  .store Shopping Cart Step 3

Add the following HTML markup to this template:

Note The second line adds the row title.

<tr><td><table>

<tr><th class="IntRow" align="right">My Shopping Cart Header Column:</th>

<td class="DataRow">~~IT_ShoppingCartHeader.UDF_Cart_Header$~~ </td></tr>

</table></td></tr>

 

Expand or collapse item  Customer Inquiry

Add the following HTML markup to this template:

Note The first line adds the row title.

<tr><th class="IntRow" align="right">My Customer Column:</th>

<td class="DataRow">~~AR_Customer.UDF_Customer$~~</td></tr>

 

Expand or collapse item  Customer Maintenance

Add the following HTML markup to this template:

Note The first line adds the row title.

<tr><th class="IntRow" align="right">My Customer Column:</th>

<td class="DataRow"><input type="text" name="UDF_UID_Customer_Change" value="~~AR_Customer.UDF_Customer$~~" size="51" maxlength="50"></td></tr>

 

Expand or collapse item  View .order Shopping Cart

Because the shopping cart value is available only after this page is submitted, an expression is used to display the customer value if the shopping cart value is not available. Add the following HTML markup to this template:

Note The second line adds the row title.

<tr><td><table>

<tr><th class="IntRow" align="right">My Shopping Cart Header Column:</th>

<td class="DataRow"><input type="text" name="UDF_Cart_Header" value="~~TBL(NOT(NUL(IT_ShoppingCartHeader.UDF_Cart_Header$)),AR_Customer.UDF_Customer$,IT_ShoppingCartHeader.UDF_Cart_Header$)?x~~" size="51" maxlength="50"></td></tr>

</table></td></tr>

 

Expand or collapse item  Confirm .order Shopping Cart

Add the following HTML markup to this template:

Note The second line adds the row title.

<tr><td><table>

<tr><th class="IntRow" align="right">My Shopping Cart Header Column:</th>

<td class="DataRow">~~IT_ShoppingCartHeader.UDF_Cart_Header$~~ </td></tr>

</table></td></tr>

 

 

For more information, see Customizing Your Web Pages.


 

© Sage Group plc 2019. Privacy Policy | Copyright/Trademarks