Creating forms for publishing


To create forms for publishing:

  1. Create a form named Purchase Order.
    This is the parent form.
    1. Add the following character fields to the form:
      • PO ID
      • Company Name
      • Description
      • Phone Number
    2. Provide a default value for the Submitter and Short Description fields because they are required fields.
      Your form should be similar to the sample in the following figure:

      web_services_examples_poform01.JPG
    3. (Optional) Hide the core fields on the form (that is, all except those you created in step 2).
    4. Click the Definitions tab.
    5. Expand the Indexes panel and click the New button to create a new index definition.
    6. Click the Add button, select the PO ID field, then click OK.
    7. In the Unique Index column, change the Unique Index value to Yes.

      You must define an index for the PO ID field because the PO ID is the primary key in this scenario. Usually, however, Request ID is the primary key. An index is predefined for the Request ID field, by default.

    8. Assign public permissions to the form.
    9. Save the Purchase Order form.
  2. Create another form named Line Items.
    This is the detail form.
    1. Add the following character fields to the Line Items form:
      • Line Item PO ID (the foreign key)
      • Item ID (the distinguishing key)
      • Item Name
    2. Add an integer field named Quantity to the form.
    3. Set the Data Length of the Line Item PO ID and Item ID fields to 40.
    4. Provide a default value for the Submitter and Short Description fields because they are required fields.
      Your form should be similar to the example in the following figure:

      web_services_examples_liform.gif
    5. (Optional) Hide the core fields on the form (that is, all fields except those you created in step 2a.)
    6. Click the Definitions tab.
    7. Expand the Indexes panel and click the New button to create a new index definition.
    8. Click the Add button.
    9. Use the Field Selector to select the Line Item PO ID and Item ID fields, and click OK.
    10. In the Unique Index column, change the Unique Index value to Yes.
      Making the distinguishing key and the foreign key unique keeps the data consistent, even if the data is submitted with other tools on the form.
    11. Click OK to save your index definition.
    12. Assign public permissions to the form.
    13. Save the Line Items form.

      The following steps are optional. They enable you to view the line items of the corresponding purchase order in the same form.

  3. Open the Purchase Order form.
  4. Right-click a blank area of the form, and select Create a New Field from the context menu.
  5. Create a table field using the Table - List View option.
  6. Select the field, and highlight the Tree/Table Property on the Properties tab.
  7. Click the corresponding ellipsis button in the Value column on the Properties tab.
  8. In the Form Name field of the Tree/Table Property dialog box, enter the Line Items form.
  9. In the Qualification field, enter this qualification to make sure that the PO ID from the parent form (Purchase Order) matches Line Item PO ID from the Line Items form:
    $PO ID$ = 'Line Item PO ID'

    If Request ID is your primary key, enter this qualification instead: $Request ID$ = 'Line Item PO ID'

    web_services_examples_poform_table_props.gif

  10. Add the following fields to the Table Columns list:
    • Item ID
    • Item Name
    • Quantity
  11. Click OK to close the Tree/Table Property dialog box.
    Your form should look similar to the example in the following figure:

    web_services_examples_poform02.JPG
  12. Save and close the Purchase Order form.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*