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!

Javascript in Dynamic action : Stop processing and issue APEX error

RunrigApr 21 2020 — edited Apr 21 2020

I have a very simple javascript in my dynamic action processing block (there are additional actions after this one). This script just s=checks to make sure at least 1 value in the Interactive Grid has a value of Y.

All I want to do is stop processing if no rows are set to Y and output a message. My Javascripting skills are non existent. The code below always returns false. and therefore never gets to the next dynamic action.

The code is below

var widget = apex.region('BULKAPPROVE').widget();

var grid   = widget.interactiveGrid('getViews','grid');

var model  = grid.model;

var valset = false;

model.forEach

(    

    function(r)    

    {             

        if (model.getValue(r,"APPROVED") == 'Y')        

        {            

            valset = true;                   

        };    

    }     

);

if (valset == false)

{

    alert("At least one SSR must be selected for approval ?");

    return false;

}

else

{

    return true;

}

This post has been answered by Runrig on Apr 21 2020
Jump to Answer
Comments
Post Details
Added on Apr 21 2020
3 comments
1,630 views