Set Focus on Column if Value is null IG - Oracle Apex

1) Set DA Lose focus on Column .i.e XNQTY

Event:- Lose Focus
Column: XNQTY
Client Side Condition :- Java Script Expression

     ((apex.item('XNQTY').getValue() == '') ||
     (apex.item('XNQTY').getValue() == 0)||
      (apex.item('XNQTY').getValue() <= 0))


2) Action :- Execute JavaScript Code
   var recordId, grid$,
    val = apex.item(this.triggeringElement).getValue();
    grid$ = $(this.triggeringElement).closest(".a-GV");
    recordId = grid$.grid("getActiveRecordId");
   //End Here :- Get Current Cell Value  from Grid
   
    apex.server.process("CheckNull",{x01: val},
    {
dataType: 'text',
success: function(pData){
$s('MSG',pData); // store message in Item ,if required to display on page
if (pData  != '') {
            apex.message.alert("Quantity must be > 0", function() {
                setTimeout(function() {
                    grid$.grid("gotoCell", recordId, "XNQTY");
                    }, 80);
            });}}});

3) Ajax Process (CheckNull)

if APEX_APPLICATION.g_x01 is null  or APEX_APPLICATION.g_x01 ='*'  or APEX_APPLICATION.g_x01 <=0 then
htp.prn('Should not be null');
end if;

Comments

Popular posts from this blog

Telegram Integration with Oracle

The username or password for the connection pool named |apex||, are invalid, expired, or the account is locked

Enabled SQL Developer Web (SDW) & ORDS Database API ORDS 19.4