Add a close work order button

When a user completes the task or tasks, the work order should be closed. This procedure describes how to put a close button on the EXWorkOrder form and update the status of the work order to close. This procedure adds a display application option definition, adds a State definition for EXWorkOrder.view, and adds a Process definition for EXWorkOrder.close.

Note This procedure does not explain how to include validation for this activity. You would use Format Control to add validation.

To create a display application option definition for EXWorkOrder.view, follow these steps:

  1. From the System Navigator, click Tailoring > Tailoring Tools > Display Options top open the Display Application Screen Definition form.
  2. Type EXWorkOrder.view in the Screen ID field.
  3. Enter the following information.

    Field Value
    Unique ID Automatically generated (EXWorkOrder.view_close)
    Action close
    GUI option 5
    Text Option 5
    Bank 1
    Condition true
    Default Label Close
  4. Click Add.
  5. Click OK.

To update the EXWorkOrder.view state definition, follow these steps:

  1. From the System Navigator, click Tailoring > Document Engine > States to open the State Definition form.
  2. In the State field, type EXWorkOrder.view and then click Search. The EXWorkOrder.view state definition form opens.
  3. Add the following to update the state definition form.

    Field Value
    Display Action close
    Process Name EXWorkOrder.close
    Condition true
  4. Click Save and then click OK.

To add a process definition record for EXWorkOrder.close, follow these steps:

  1. From the System Navigator, click Tailoring > Document Engine > Processes to open the Process Definition form.
  2. Type EXWorkOrder.close in Process Name.
  3. Click Add.
  4. On the Initial Expressions tab, type the following expression:

    • status in $L.file="Closed"
    • $L.mode="closed"
  5. Click Save.
  6. On the RAD tab, enter the following information:

    Field Value
    Expressions evaluated before RAD call $L.EXaction="update"
    RAD Application se.base.method
    Condition true
    Parameter Names
    Parameter Values
    file $L.file
    prompt
    $L.EXaction
    second file $L.file.save
    record $L.fc
    second.record $L.object
    boolean1 false
  7. Click Save and then OK.