Get Interactive Column Sum into a page item

In my last post I have posted, how to get selected row values into a page item using javascript expression and dynamic action. Now I am writting some javascript code to get the column sum into a page item.

 

IG Report column sum

Steps

  • Create Dynamic Action on event “Selection Change[Interactive Grid]” and select your IG Report region.
  • Create action on “Execute JavaScript Code” and use below code.
var net_amt
model = this.data.model,
records = this.data.selectedRecords;

var amt = 0;
records.forEach(record => amt = amt+Number(model.getValue( record, "SAL")));
apex.item( "P4_TOTAL_SAL" ).setValue (amt);

Click here to see the demo.

You may also like...

3 Responses

  1. CICT says:

    Hi,
    This post is important for me. I wanted to use but it is not working in my side..

    Thanks

Leave a Reply

Your email address will not be published. Required fields are marked *