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!

Calculated Column in Oracle apex Interactive Grid

gkthomasNov 2 2022 — edited Nov 2 2022

I am trying to set a calculated column in Oracle interactive Grid. Its value must be the sum of two other columns. ( P1_AMT and P2_AMT. The calculated column is TOTAL_AMT. its set as a text field and source is none. In java initialization section I added the following code. However Total Amt is empty. Can someone help ? I am on Oracle apex 20.2 using chrome

function(options){
options.defaultGridColumnOptions = {
dependsOn: ['P1_AMT', 'P2_AMT'],
calcValue: function(_argsArray, model, record){
const AMT1 = parseFloat(model.getValue(record, 'P1_AMT') || 0);
const AMT2 = parseFloat(model.getValue(record, 'P2_AMT') || 0);
if(isNaN(P1_AMT) || isNaN(P2_AMT)){
return 'error';
} else {
return (AMT1 + AMT2);
}
}
};
console.log(options);

return options;  

}

George

This post has been answered by Hamza Al-abbasi on Nov 4 2022
Jump to Answer
Comments
Post Details
Added on Nov 2 2022
10 comments
4,837 views