Form design notes - dynamic default values

SAP F4 Look up

One way to dynamically set a field is to allow the user to look up values directly in SAP for a specified field (from the form). You can do this by adding a custom Winshuttle control (WS.SAP Field Lookup) to the InfoPath form.

Note: This is only available for fields that SAP supports F4 lookup (e.g. New Weight does not support F4 but Weight Unit does).

  1. In InfoPath, drag and drop the WS.SAP Field Lookup control on the form next to the field you want to use the Look up value for
  2. Right-click the control icon , and then select SAP Field Lookup Properties
  3. Click the SAP Field Lookup Tab
  4. Next to Mapping Name, click the drop-arrow, and then select the Script that contains the Look up field
  5. Next to SAP Field, click the drop-arrow, and then select the Field you want the F4 lookup to use.
  6. Click OK.

    See video and further info in the following Winshuttle blog entry.

Using drop down lists to filter data

You can use a drop down list for one field to filter data of another field.

For example, you can create a drop down list for Distribution Channel that is dependent on the selection for Sales Organization (manual selection of a drop down). The actual drop down list for the distribution channel can contain all possible values, but a filter can reduce the drop-down list based on the value of the Sales Organization.

Note: You can disable the dependant (e.g. dist. Channel) field until the related field(e.g Sales Org.) is populated.

You can set values of drop-down lists/pick lists a number of ways. (See Populating Pick lists on forms)

Whichever method you choose, you can dynamically set up a filter based on a different field(s) in a form.

  1. Right-click on the dropdown field and select Drop-Down List Box Properties.
  2. Use one of the following two choices from the List box choices

    Get choices from fields in this form: Use this if you want to use a Query output (select the repeating section) to be values for a drop down field.

    Get choices from an external data source: Use this if you want to use an external source such as a SQL query or SharePoint list.

  3. Click the Select Xpath button for the Entries
  4. Click Filter Data…
  5. Set your filter criteria. Typically a field in the external data source equals a field in the form.

Using Action Rules to set field values

To dynamically set one or more fields value based upon a value entered in another field, follow these steps:

  1. In InfoPath, highlight the field on the form view you want to use to derive another field. For example, if a value for Plant derives the MRP type, then you should highlight the Plant field.
  2. Under Rules (see InfoPath menu bar Properties à Manage Rules) click New
  3. Click Action.
  4. In the Condition dialog box, click none (because you have not created a condition yet).
  5. Create the condition, and then click OK.

    Note: When the condition is true it will require the action (in this case plant_1 =1000). The AND or OR operators can be used here, too.

  6. Next to Run these actions (under the same "Rules" dialog box - see below) Click Add.
  7. Click Set a fields value from the dropdown.
  8. Select the field you want to set based on the condition above (e.g. MRP Type)
  9. Select the value of the field in step 9 (note you can use a formula for the value if needed)

  10. Click OK

Promoting fields to drive workflow decisions

When using conditional workflow, you will need to promote the fields on the form that drive workflow decisions. To promote a field in InfoPath, do the following:

  1. On the InfoPath menu bar, click File, and then click Form Options.
  2. Click Property Promotion
  3. Click Add
  4. Select the field from the form, and then click OK.