25.1.9.1.8.9.6 Working with a Business Entity Row

Show or update the related business row from a task-specific details page.

If your task is tied to a business entity row and you use a Details Primary Key, you may need to view data from that row in your Task Details page to provide additional context. You also might want the actual owner to store additional data right away into columns in that row. Add a Form region to your Task Details page to display and edit the appropriate columns from this related data row. If you do, adopt one of the following approaches.

Suppose that your form region's primary key page item is named P6_ID. For the form to load its existing column data, populate the value of P6_ID with the Details Primary Key in the Pre-Rendering section of your page before the Form - Initialization page process executes. Do that in one of two ways:
  • Use the hidden P6_TASK_ID to query the DETAIL_PK from the APEX_TASKS view, or
  • Edit the task definition's Task Details Page URL to pass P6_ID as &DETAIL_PK.
To adopt the first approach, add a Pre-Rendering computation for P6_ID with the query:
select detail_pk
  from apex_tasks
 where task_id = :P6_TASK_ID

With the second approach, the P6_TASK_ID value is already set by the Task Details Page URL.

In either case, the Form - Initialization page process in the Pre-Rendering section of your page loads all of the Form region's columns using that primary key value. Enable the Query Only switch on any columns that should be read-only in the page. If you let the assignee edit any of the columns to acquire additional data, then ensure you have a Form - Automatic DML page process related to the form region in your page's Processing tab. It should have a server-side condition to trigger on for SAVE and COMPLETE buttons. It automatically saves the changes back to the business entity row when the user submits the page. For an approval task, the buttons are named APPROVE and REJECT instead of COMPLETE.

Tip:

If updating the business entity row immediately is not appropriate, then use updatable task parameters instead to capture the pending additional data. Then define a task action on the Complete event to update business entity row columns with task parameter values at completion time.