4 Replies Latest reply: Aug 11, 2014 7:28 PM by HarryF RSS

    created date

    PRO Rachel



      I'm creating a basic (one table with insert, update, report, success, and login pages only) application. This will be used to process and track requests from one group of users to another. For each record, I'd like to capture the created date, created by user, last updated date, and last updated by user. I want these to be read only, captured by the system and displayed on the report page. I'm struggling to make this work. Can anyone help, please?

      Let me know if you need additional info.



        • 1. Re: created date

          database trigger.

          • 2. Re: created date

            To get app user in trigger: nvl(v('APP_USER'),USER)

            • 3. Re: created date

              If you have created the field in the form then make them display only and specify the default value of these field. The only problem with this is the fields will be populate at time of page load. So if you take 5 min to enter the form then there will be a time diff. To over come this you can create a trigger and assigned the value with in the trigger to overwrite.



              P1_created_by field

              Display as  : Display only

              Save session State: Yes

              Default value : v('APP_USER');

              Default value type: PL/SQL expression

              Apply changes

              For created date

              Default value : sysdate

              Default value type: PL/SQL expression

              for modified date and modified by

              put a condition

              Value of Item / Column in Expression 1 Is NOT NULL

              and Specify Primary key field name in expression 1.

              • 4. Re: created date

                If you want the fields in the pages you can reset the dates on a computation. In my experience its better to leave them out. If they are in pages they can have issues with default date formats and if you need to do something with them you have to find them everywhere in the App. Easier in triggers.