Using JavaScript to set page item values from a report in APEX

Simple use case, you can set multiple page items from a link in a report region by calling apex.item().set_value multiple times in the same statement:

javascript:apex.item("P4_LOC").setValue("#LOC#"); apex.item("P4_DEPTNO").setValue("#DEPTNO#");

A better practice would be to create a JavaScript function that does your dirty deeds and then call that once:

javascript:MyFunction(#LOC#, #DEPTNO#);

An advanced method would be to call an AJAX process, but sometimes that's too much.

 

Comments