Reputation: 11
i have Apex interactive report (version 20.2) where i created 'pencil' to edit row in grid. On that edit page i have column which when i update to Yes i would like to automatically other column change to current date. Column one is dropdown menu with yes and no and affected one should be date (when other is changed)
Thank you
I tried this but i got error and i think i need to modify PL/SQL expression Dynamic action's action is Set value:
set type: PL/SQL expression PL/SQL expression: :P7_COLUMN1 items to submit: P7_COLUMN1 affected elements: item, P7_DATE
Upvotes: 0
Views: 390
Reputation: 18665
There are a couple of caveats here:
Using a dynamic action. This should work, however.... in APEX all page items are strings. So you'll have to convert to VARCHAR2 in the format mask that is used in your application. There is a downside to this approach. What if the user selects "Yes" and then changes his mind ? The date column will already be updated and there is no way to revert (unless you have a 2nd page item that has the original value and you have another dynamic action to revert). This gets very messy very quickly
Consider using a computation on submit to set the date. This can work if the form is not displaying the date. You could also put a serverside condition to only set the new date if the value actually changed from No to Yes.
Or consider a trigger. This moves the business logic in the database but if the time fraction of the date is important this might be the preferred solution.
Upvotes: 0