Setting the value of a form field from a request

I have a form field in which one of the values ​​has a default value defined in the application settings table. The user will see the default value when the creation form is displayed, but can change it to another value, if he wants, before saving a new line.

The default field does not indicate that the default value is the result of an SQL query (for example, select default_rate from app_defaults, where row_key = 1).

Of course, this should be possible, but how?

+4
source share
2 answers

As stated above in Jeffrey, the final decision can be made entirely in APEX, but using the default class = PL / SQL in the page element.

DECLARE default_value number(9,2); BEGIN SELECT deflt_rate INTO default_value FROM app_defaults WHERE row_key = 1; RETURN default_value; END; 
+8
source

You can use the SQL query in the PL / SQL block to directly assign it, for example.

 SELECT default_rate INTO :myblock.rate FROM app_defaults WHERE row_key = 1; 
+2
source

Source: https://habr.com/ru/post/1342190/


All Articles