This content has been marked as final. Show 4 replies
try Pre-Text-Item it Perform an action before Form Builder navigates to a text item from the record level.
IF :System.Record_Status ='CHANGED' THEN -- you can also try NOT NEW :System.Record_Status
Hi,1 person found this helpful
I have a multi records tublar data block. there is a colum called expiry_date. The logic is:
1 In sert mode, this colum is protected and null values will be saved into the database.
2. In update mode, when user click "Expiry_date" colum, this colum is automatically populated with system date
Could you advise what's the best way to code this logic?
If Expiry_date is anyway not to be entered by a user then why do you need it on the Form as displayed/enterable item? It should be hidden. And you should write a Before Update For Each Row trigger on the table to set :NEW.EXPIRY_DATE := SYSDATE.
Hi Michael1 person found this helpful
ON-INSERT Trigger or PRE-INSERT Trigger
there is No UPDATE MODE u can use ....
:expiry_date := ' ' ;
ON-UPDATE Trigger or PRE-UPDATE Trigger but this is not exactly what u want to do but may be an initial step
:expiry_date := SYSDATE;
IF :SYSTEM_MODE != 'INSERT' THEN :expiry_date := SYSDATE; END IF;
Hope this helps...
Edited by: Amatu Allah on Jun 21, 2012 12:05 AM
I have taken your advice and put code in Pre-Text-Itemtrigger and it works fine most of time. But there is one issue with this Pre-Text-Item trigger.
When I update expiry_date and set it to null again and save it. The null value actually saved into database but Pre-Text-Item trigger fires again and automatcally populates expiry_date with sysdate again, which makes user think sysdate is the value for expiry_date
in the database.
Could you please advise how I can fix this issue?
Thanks in advance!!