Initialize workflow

You can use a query to set the value of a workflow attribute.

A query is used if the value cannot directly be retrieved from an ERP table field.

For example you can:

  • You can calculate the total amount of an order
  • You can retrieve information from another table based on the value in an ERP table field.
General

The query can retrieve:

  • A specific value of an ERP table field (ENtgwms.sqlf.value)
  • The lowest value of an ERP table field (ENtgwms.sqlf.minimum)
  • The highest value of an ERP table field (ENtgwms.sqlf.maximum)
  • The sum of an ERP table field (ENtgwms.sqlf.sum)
  • The average of an ERP table (ENtgwms.sqlf.average)
  • The number of occurrences of an ERP table field (ENtgwms.sqlf.count)
Note

The text in parenthesis is the Query Function you must use to accomplish the task mentioned.

Based on the query field conditions, the range of records is determined that the query will work upon.

To create a query
  1. Start the Queries (tgwms1560m000) session.
  2. Click New.
  3. Specify a query name and a short description of its function.
  4. Double-click this query and specify the Query Function and the ERP table field name whose value will be used to fill the workflow attribute at runtime.
  5. On the appropriate menu, select the Query Field Conditions command to specify the query conditions.

    The total condition (WHERE clause) can consist of individual conditions and are connected by a logical AND.

  6. Choose the Check Query Syntax command on the appropriate menu to check the syntax of the query.

    A dialog box with the error messages is displayed.

  7. Choose the Evaluate Query command on the appropriate menu to test the query.

    This only works if the Query Syntax is correct. As a result, the query is displayed in a SELECT, FROM, and WHERE format, together with the outcome of the evaluation.

  8. If the evaluation is ok you can use the query to set a workflow attribute's value.
Where you can use a query

A query can be linked to a workflow attribute (binding).

To bind a query to a workflow attribute: