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!

Interactive grid checkbox returns wrong value.

Radwan salamehApr 10 2025

Hello,

The checkbox in the Interactive Grid returns the wrong value on change.

I created a dynamic action of type "Selection Change [Grid]" to get the checkbox value and refresh the grid based on that value.

The checkbox is supposed to return 'Y' when checked and 'N' when unchecked. However, when I check the box, it returns a null value. If I double-click and focus on the checkbox field, it correctly returns 'Y'.

When I check and then uncheck again the box, it returns N , even though it should return 'Y' when checked and 'N' when unchecked.

Has anyone else encountered this behavior in the Interactive Grid?
What is the solution, please?

Here is my code:

var model = this.data.model;

// Check if there is a selected record
if (this.data.selectedRecords[0] && this.data.selectedRecords[0].length > 0) {
    // Get the selected record
    var record = this.data.selectedRecords[0];
    
    // Get the "ROLE_NAME" value
    var roleColumnValue = model.getValue(record, "ROLE_NAME");

    // Get the "ENABLED" checkbox value
    var checkboxValue = model.getValue(record, "ENABLED");

    console.log(checkboxValue);

    // Check conditions
    if (roleColumnValue === "MAST_MIS" && checkboxValue === 'Y') {
        apex.message.confirm('Role not permitted for Input User', function(confirmed) {
            if (confirmed) {
                model.clearChanges(); // Clear any unsaved changes
                // Optionally, if you want to uncheck it directly without refresh:
                // model.setValue(record, 'ENABLED', 'N');
                apex.region("ALLOW_ROLES").refresh(); // Refresh the region
            }
        });
    }
}
This post has been answered by Radwan salameh on Apr 10 2025
Jump to Answer
Comments
Post Details
Added on Apr 10 2025
2 comments
193 views