Home Search

DriveWorks Pro 21
How To: Delete Rows From A Group Table (KB13103008)

Send Feedback

How To: Delete Rows From A Group Table

This topic describes how to delete rows from a Group Table using the Delete Group Table Rows task.

Deleting a row from a Group Table is permanent. Take a backup of the Group Table before experimenting with this feature.

Delete a Single Row from a Group Table.

Ensure a Group Table exists, we recommend executing this example on a backup of your existing Group Table.

The Delete Group Table Rows task matches values to the Field Names in the Group Table, to delete the row.

The image above shows a sample Group Table. The Field Names are the column headers and always exist on the first row of a Group Table.

This example will use the Field Names from Columns B and C to uniquely identify the row to be deleted.

Decide when the task will be run

When running a specification, a task can be executed by the following methods:

  • Pressing a Macro Button on a form.
  • Part of the Specification Flow.

Macro Button

To run the task from a Macro Button, follow the steps below:

  1. With your project open in DriveWorks Administrator, go to Specification Macros (Stage 5: Specification Control).
  2. Click Add to add a new specification macro.
  3. Enter a name for the macro, click OK.
  4. With the new macro highlighted in the Macros column, drag the Delete Group Table Rows task from the toolbox to the Tasks column.
  5. See Delete Group Table Rows Task below to complete the properties for this task.

Specification Flow

To run the task as part of the Specification Flow, follow the steps below:

  1. With your project open in DriveWorks Administrator, go to Specification Flow (Stage 5: Specification Control).
  2. Choose the State the task is to be run on.
  3. Click Edit on that State and decide which of the State Items is suitable to run the task:
    • Event - The task can be run on the Enter or Leave Event.
    • Operation - The task can be run when the chosen operation is selected for the specification from the Specification Explorer.
    • Transition - The task can be run when the State transitions to another State.
  4. With the State Item selected drag the Delete Group Table Rows task from the toolbox to the Task Sequence section.
  5. See Delete Group Table Rows Task below to complete the properties for this task.

Delete Group Table Rows Task

  1. Select the Delete Group Table Rows task.
  2. Select the Table Name property and choose the Group Table from the drop down box.
  3. Select the Field Names property and type the Field Names that will uniquely identify the row to be deleted. Separate multiple Field Names with the pipe delimiter |.

    From the image at the top of this topic this will be:

    CompanyName|ContactName.

  4. Select the Match Values property. It is highly likely that this property will be a rule that uses values that change for each specification made. To build a rule the property must first be made dynamic by double clicking the grey orb so it turns green.

    Once the orb is green click the build button to launch the Rules Builder.

  5. The rule needs to retrieve values that correspond to the Field Names property.

    For example a project may have some form controls where the Company Name and Contact Name are selected from, so the rule here will be:

    CompanyNameReturn&"|"&ContactNameReturn

  6. If the task was being set up from the State editor in the Specification Flow click OK to close the editor.

Test

  1. Go to Specification Explorer (Stage 6: Specification) and click New to start a new specification to test this out.


Knowledge Base Article Ref:KB13103008