Row Initialization event on the IG region (Set Default value for column of Row)- Oracle Apex

1)  Create a dynamic action for the Row Initialization event on the IG region.

2) Event :- Row Initialization
   Action :- Execute Java Script code
    Set Fire on Initialization to No'

var val,
    model = this.data.model,
    rec = this.data.record,
    erec =  $v("P404_ITEM_CODE"),
    erec1=$v("P404_COMPCD"),
    meta = model.getRecordMetadata(this.data.recordId);

if ( meta.inserted ) {
    val = model.getValue(rec, "ITEM_CODE")
    if ( val.v === val.d )
      {
model.setValue(rec,"ITEM_CODE", {d:apex.item("ITEM_CODE").displayValueFor(erec), v: erec});
    }
    val = model.getValue(rec, "COMPCD");
    if ( val.v === val.d ) {
        model.setValue(rec,"COMPCD", {d:apex.item("COMPCD").displayValueFor(erec1), v:erec1});
    }
    }

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