Discussions
Categories
- 196.7K All Categories
- 2.2K Data
- 235 Big Data Appliance
- 1.9K Data Science
- 449.8K Databases
- 221.6K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 549 MySQL Community Space
- 477 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3K ORDS, SODA & JSON in the Database
- 532 SQLcl
- 4K SQL Developer Data Modeler
- 186.9K SQL & PL/SQL
- 21.3K SQL Developer
- 295.4K Development
- 17 Developer Projects
- 138 Programming Languages
- 292.1K Development Tools
- 104 DevOps
- 3.1K QA/Testing
- 645.9K Java
- 28 Java Learning Subscription
- 37K Database Connectivity
- 153 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.1K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 17 Java Essentials
- 158 Java 8 Questions
- 85.9K Java Programming
- 79 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.2K Java SE
- 13.8K Java Security
- 203 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 395 LiveLabs
- 37 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.6K Other Languages
- 2.3K Chinese
- 170 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 230 Portuguese
Interactive Grid - Column - Not Updatable by User - But updatable through DA

We are in Application Express 20.2.0.00.20.
I have two regions.
Example: Dept (Master)
Emp (Detail)
Whenever the user clicks on the Department region record, detailed employee region Interactive Grid data will get a refresh.
I have the following requirement on detail region.
1) Commission column is not updatable/enterable by the user.
2) Commission column is calculated based on the department selected on each record of the employee.
3) I should be able to save this entire record.
When I disable the commission column, the value is not getting saved into the database.
I tried using multiple Dynamic Action events to enable and disable the Commission field, but still, time the value of the Commission not getting saved into the database.
I have seen a couple of posts on making display field and Hidden field combinations and it doesn't seem to be working in this version.
Please share.
Answers
-
Please share your ideas.
-
Use Process, not DA.
-
Thanks for your response.
If I understand correctly, process is to update the data into the database. But, in this case I have to display commission value to the user. Once user satisfies the data calculated on the commission column, he will press the save button.
-
Part of the problem may be the way you "disabled" the column. There are several ways to stop the user entering data in a field and/or saving it to the database: disable it with a DA (as you seem to have done), make it read only declaratively using the Read Only column setting or with CSS (e.g. built in "is-readonly" class), turn the Query Only switch on - which will stop it being saved - etc.
The key thing is that in the IG a change must be made in a record for it to be included in the update. If the user doesn't make any change, but you want the record to be saved, you will have to include a hidden field which you populate using code. In your case, since you say the user has to be satisfied with the calculated commission, do you have a field which the user updates to indicate this?
One way I use to accomplish what I think you're aiming at is to create a calculated field in the IG, using an SQL Expression as the column Source. By definition the field is not updateable by the user and your SQL expression can reference any columns in the current record and any page items. Have the user make some change to the record by selecting the department or indicating acceptance of the commission. You will need to write your own PL/SQL process to save the grid and use :APEX$ROW_STATUS to distinguish updates, creates and deletions (if you allow them all).
Alternatively the commission field can be a database column made read only using CSS. For example you could write a DA on change of department that would calculate the commission. Use a Remove Class action to allow the commission field to be changed, populate it, then use an Add Class action to make it read only again.