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!

ApEx Javascript - get the query column name for a report field

S.BovinJan 14 2017 — edited Jan 14 2017

I am using ApEx 3.2.1 and cant upgrade for a few months

Using javascript - is it possible to programatically get the column name that a field is based on ?

For example, I have a report based on ...

SELECT id, name, city || ' ' ||postcode  city_description

from    employees

This shows a tabular list of records in a report region on an ApEx page.

So far I have been using code like this to get the fields.

var FEmployeeNameField = document.getElementsByName('f02');

var FCityDescriptionField = document.getElementsByName('f03');

This is not stable as the field number will change if another column is added to the query.

It will also change if I change the report column attribute from "Text (Saves Stat)e" to "Standard Report Column" as standard report columns do not appear in the elements list

I would like to find a function that lets me get the field based on the column name or column alias, similar to this

var FEmployeeNameField = document.getElementsByColumnName('NAME);

var FCityDescriptionField = document.getElementsByColumnName('CITY_DESCRIPTION');

I hope that makes sense

Thank you for any assistance that you can offer.

Steve B

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 11 2017
Added on Jan 14 2017
3 comments
1,487 views