Inserting the Tax fields

The purchase order needs to calculate the appropriate state and federal taxes. To do this, you create a field that shows the tax rate and a calculated field that shows the tax amount.

To insert the State Tax % field

  1. In the Object Library palette, click the Standard category and then drag the Numeric Field object  onto the form below the Total field.

  2. Select the caption text in the Numeric Field object and type State Tax % .

    You may want to resize the field to make it smaller.

  3. In the Object palette, click the Field tab and select Solid Box in the Appearance list.

  4. Click the Patterns button and in the Pattern box, type z9.99% .

  5. Click the Binding tab and type stateTaxPercent in the Name box.

  6. Click the Value tab and in the Default box, type 6 .

To insert the State Tax field

  1. Copy the State Tax % field and position the new field beside the State Tax % field.

  2. Select the text and type State Tax .

  3. In the Script Editor, select Calculate from the Show list.

  4. Select FormCalc from the Language list and Client from the Run At list.

  5. In the Script Source field, type the following calculation:

    (total * stateTaxPercent / 100)

  6. Deselect the Numeric Field object to add the script to your form, then select it again.

  7. In the Object palette, click the Binding tab and type stateTax in the Name box.

  8. Click the Field tab, click the Patterns button and in the Pattern box, type $z,zz9.99 .

  9. Click the Value tab and in the Type list, select Calculated - Read Only.

To insert the Federal Tax % and Federal Tax fields

  1. Repeat the procedure for inserting the State Tax % field.

  2. Repeat the procedure for inserting the State Tax field.

  3. Ensure the following changes to make the fields applicable for Federal Tax:

    • Change all instances of the word state to federal .

    • Set the default value for the federal tax percent to 8.

    • Set the calculation for federalTax to:

      (total * federalTaxPercent / 100)

Click to continue: Inserting the Shipping Charge field

// Ethnio survey code removed