Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

IG - set default column values based on initalization action

Bruce ClarkAug 23 2024 — edited Aug 26 2024

Thanks very much. I still am confused as to how to meet my requirement..I am using APEX 24.1

On an interactive grid, I need to default column values when a new row is created. However, the default values are different if the row is created from the "Add Row" button on the toolbar, or from the row actions menu.

To accomplish this, I created a dynamic action with the event set to Initialize Row (grid). There is a true action set to "Executive Javascript.

For the javascript, I am using:"

var region = apex.region(this.milestones_grid); // Replace `this.regionName` with the actual region ID
var model = region.widget.getModel();
// ... rest of your code
var record = this.data.record;
var action = this.data.action;

if (action === "add-row") {
// Set defaults for add-row action
model.setValue(record, "DESCRIPTION", "MILESTONE");

} else if (action === "selection-add-row") {
// Set defaults for selection-add-row action
model.setValue(record, "DESCRIPTION", "TASK");

}

When the row row is created, default values are not being set.

Please can you offer me your kind guideance.

Thanks

Comments
Post Details
Added on Aug 23 2024
5 comments
1,335 views