Hi, experts:
In Apex 20.1.
Aims: It will be a common use case that users Browse a grid of records and then select one of them to edit in a form. and all these atctions will be happened in the same page.
Possible Choices:
-
By useing Create page wizard in APP Builder, I can easily create a grid for viewing records in one page and a form for editing the selected record in another page.
-
Also there are examples in APP Gallery that a grid for viewing a master tables' records and editing the detail table's record of another grid in the same page.
My tryings:
In the example of Sample Master Detail in App Gallery, there is a Interactive Grid of Milestones in page 17, then I
-
Create an Item named P17_ID_M to store the selected ID of the Milestones record.
-
Create a Dynamic action named SelectMilestone to set the value of P17_ID_M.
Execute JavaScript Code for the SelectMilestone Dynamic Actions
var model = this.data.model;
var selectedRecords = this.data.selectedRecords;
if(this.data.selectedRecords.length > 0) {
apex.item(
"P17_ID_M").setValue(model.getValue(selectedRecords[0], "ID"));
}
-
Create a Sub Region named MILESTONE 2 with a Form Type based on the same table as the above Milestones.
-
set the selected id value ( P17_ID_M ) as the filter criteria for the sub region (MILESTONE2) form
see bellowing images:

But these tryings doesn't work!
When records selection changed in the grid, the related form record doesn't showing anything .

What did I missed? and what is the best practice to fullfill my above aim?
Thanks in advance.