Need to display/update last date/time of an accessed record

Hi All,
I'm using ADF BC and I have a use case where I need to display the last date/time when a user access a record in a view. I have a user table that I access thru a view object where I can store the date/time of the fetched record. A viewLink from that view object gives me the detail information in that record.
I generated a ViewRowImpl class and added this to the method that get the time and date (DtHeureDernAcces is a private variable in defined in the class):
/**Gets the attribute value for the calculated attribute DtHreDernAcces
public Date getDtHreDernAcces()
if (DtHeureDernAcc==null)
DtHeureDernAcc=(Date) getAttributeInternal(DTHREDERNACCES);
setDtHreDernAcces(new Date(new java.sql.Timestamp(System.currentTimeMillis())));
getApplicationModule().getTransaction().commit();
return DtHeureDernAcc;
This works fine until the user refresh the page, in this case the ViewObjImpl is recreated and DtHeureDernAcc is then null. So the date/time is updated after each refresh.
How can I get around this problem ?

The complication here is that &P7_DATE_SHIPPED. and &P7_DATE_ORDERED. are session-state variables - they don't actually get updated until the page submit completes, which is happening AFTER the dynamic action.
JavaScript might provide an alternative method that will pick up the current values of those fields. You might try something like:
HTML Header
<script language="JavaScript" type="text/javascript">
function check_hours(pThis){
  var v_shipdt = $v("P7_DATE_SHIPPED");
  var v_ordrdt = $v("P7_DATE_ORDERED");
  if(v_shipdt > v_ordrdt){
    alert("Shipping Date is before Order Date!");
  return true;
</script>Put this in the HTML Form Elements Attributes of your page item:
onchange="check_hours(this)"This is just pseudocode, but it may help get you started. Dates in JavaScript are a little tricky to deal with.

Similar Messages

  • Min,Max for a time Range and Sum of Records for the last date/time

    Hi All,
    I have a table with the following structure/data:
    create table  Events   (
                                        [EventID]       
    int                   NOT NULL,
                                        [Title]            
    nvarchar(200)  NOT NULL,
                                        [SourceName]  nvarchar(20)    NOT NULL,
                                        [Type]             
    int                  NOT NULL,
                                        [eDate]           
    datetime
    insert into Events values(100, 'Event 1', 'S01', 3,'2014-01-01 00:00:00.000')
    insert into Events values(100, 'Event 1', 'S07', 3,'2014-01-01 00:00:00.000')
    insert into Events values(100, 'Event 1', 'S08', 3,'2014-01-01 00:00:00.000')
    insert into Events values(100, 'Event 1', 'S09', 3,'2014-01-01 00:00:00.000')
    insert into Events values(101, 'Event 2', 'S010', 3,'2014-01-01 00:00:00.000')
    insert into Events values(102, 'Event 3', 'S03', 3,'2014-01-01 00:00:00.000')
    insert into Events values(100, 'Event 1', 'S04', 3,'2014-01-01 00:00:00.000')
    insert into Events values(101, 'Event 2', 'S05', 3,'2014-01-01 00:00:00.000')
    insert into Events values(102, 'Event 3', 'S06', 3,'2014-01-01 00:00:00.000')
    insert into Events values(100, 'Event 1', 'S01', 3,'2014-02-01 00:00:00.000')
    insert into Events values(101, 'Event 2', 'S02', 3,'2014-02-01 00:00:00.000')
    insert into Events values(102, 'Event 3', 'S03', 3,'2014-02-01 00:00:00.000')
    insert into Events values(100, 'Event 1', 'S04', 3,'2014-02-01 00:00:00.000')
    insert into Events values(101, 'Event 2', 'S05', 3,'2014-02-01 00:00:00.000')
    insert into Events values(102, 'Event 3', 'S06', 3,'2014-02-01 00:00:00.000')
    insert into Events values(100, 'Event 1', 'S01', 3,'2014-03-01 00:00:00.000')
    insert into Events values(101, 'Event 2', 'S02', 3,'2014-03-01 00:00:00.000')
    insert into Events values(102, 'Event 3', 'S03', 3,'2014-03-01 00:00:00.000')
    insert into Events values(100, 'Event 1', 'S04', 3,'2014-03-01 00:00:00.000')
    insert into Events values(101, 'Event 2', 'S05', 3,'2014-03-01 00:00:00.000')
    insert into Events values(102, 'Event 3', 'S06', 3,'2014-03-01 00:00:00.000')
    And I wrote the following query:
     select EventID as [Event ID],
           Title, 
           count(distinct(SourceName)) as [Instances], 
           Type,
           min(eDate) as  [First Detected],
           max(eDate) as [Last Detected],
           datediff(d,min(eDate),max(eDate)) as [Delta (days)]
    from  Events
    where type = 3
    group by EventID, Title, Type
    having max(eDate) <> min(eDate)
       and max(eDate) =(select top 1 eDate from Events order by eDate desc)
    and I get the following results (see the instance number)
    Event ID Title         Instances Type First Detected                      Last Detected                    
       Delta (days)
    =============================================================================================================================
    100         Event 1         5         3    2014-01-01 00:00:00.000     2014-03-01 00:00:00.000    
    59
    101         Event 2        
    3         3    2014-01-01 00:00:00.000     2014-03-01 00:00:00.000     59
    102         Event 3        
    2         3    2014-01-01 00:00:00.000     2014-03-01 00:00:00.000     59
    This is normal for this query however what I need to do is a little different.
    In other words, while I need to show when we recorded a specific event first and last time,
    I need to display the results for the last date/time when it was recorded. 
    For example what I need to provide should look like this:
    Event ID  Title                Instances        Type       First Detected                    
    Last Detected                          Delta (days)
    =============================================================================================================================
    100         Event 1            2                   3           
    2014-01-01 00:00:00.000     2014-03-01 00:00:00.000      59
    101         Event 2            2                   3           
    2014-01-01 00:00:00.000     2014-03-01 00:00:00.000      59
    102         Event 3           
    2                   3            2014-01-01 00:00:00.000     2014-03-01 00:00:00.000     
    59
    Could you please help me to fix this query?
    TIA,
    John

    ;With cte As
    (Select EventID as [Event ID],
    Title,
    SourceName,
    Type,
    min(eDate) Over(Partition By EventID, Title, Type) as [First Detected],
    max(eDate) Over(Partition By EventID, Title, Type) as [Last Detected],
    eDate,
    datediff(d,min(eDate) Over(Partition By EventID, Title, Type),max(eDate) Over(Partition By EventID, Title, Type)) as [Delta (days)],
    max(eDate) Over() As MaxEDate
    from Events
    where type = 3)
    Select [Event ID],
    Title,
    COUNT(Distinct SourceName) As Instances,
    Type,
    [First Detected],
    [Last Detected],
    [Delta (days)]
    From cte
    Where eDate = MaxEDate And [First Detected] <> [Last Detected]
    Group By [Event ID],
    Title,
    Type,
    [First Detected],
    [Last Detected],
    [Delta (days)];
    Tom
    P.S. Thanks for providing the DDL and data.  That is always very helpful.

  • Itunes it's not showing me the last date/time the iPhone/iPad was backed up.

    I just backed up my iPhone and iPad but  iTunes it's not showing me the last date/time my device was backed up. I had just done a backup about 3 hours ago. And when I go to check the backup location I see a folder there with the time it was last backed up. But it's not showing me the backup date in iTunes. I don't know what to do.
    I already tried to remove the folder in App. Support-Mobile Sync and start a brand new backup. But no date.
    Tried to delete and start a new iTunes folder in Music but nothing has changed
    Any solution is welcome!

    iCloud requires OS X Lion (10.7.2) or higher.  You will need to upgrade to either Lion higher in order to set up iCloud on your Mac.  First check to see if your system meets the system requirements to upgrade.
    Lion system requirements are:
    Mac computer with an Intel Core 2 Duo, Core i3, Core i5, Core i7, or Xeon processor
    2GB of memory
    OS X v10.6.6 or later (v10.6.8 recommended)
    7GB of available space
    Mountain Lion requirements are shown here: http://support.apple.com/kb/HT5444.
    Mavericks requirements are shown here: http://support.apple.com/kb/HT5842.
    If you can run Mavericks, you can purchase an upgrade from the Mac App Store.  If you can only run Lion or Mountain Lion, contact the online store in your country and purchase a redemption code to download it from the Mac App Store.
    After upgrading, you will find iCloud in System Preferences>iCloud on your Mac, and can set it up as explained here: http://www.apple.com/icloud/setup/mac.html.
    Before upgrading, you may want to check the compatibility of your existing programs by checking here: http://roaringapps.com/apps:table.

  • I need to display pie chart data tips at specified location instead of default location?

    I need to display pie chart data tips at specified location instead of default location?
    can any body let me know how to do that?
    thanks guys.

    Hi,
    Check this thread.
    Log for J2EE Web Services?
    Regards,
    Harini S

  • How to find the last update date time and user of record field peoplecode

    how to find the last update date time record field peoplecode?
    Thank you.

    One can check the last update date time using the following query
    SELECT LASTUPDDTTM FROM PSPCMPROG WHERE OBJECTVALUE1 LIKE 'RECNAME' AND OBJECTVALUE2 LIKE 'FIELDNAME'

  • 8.1 not updating Last Played time/date

    Songs are playing normally, but when I check Recently Played it only shows the tracks that played just before installing the update. The Play Count is registering properly, but the time and date played are not.
    Also, I'd rather have my old shuffle function back. Genius is an optional function that can be turned off if I choose not to use it and I wish iTunes DJ was the same way.

    I'm also no longer getting last played time updated as well as play count not increasing. Also, when I rate a track from the shuffle's list, the rating does not transfer to the original track on disk. This makes manual management of tracks on a shuffle impossible. The play position is also lost.
    Apple, this is a critical bug bug, because of loss of data. Please fix it asap.

  • Display original clip date-time

    I'm using FCPX 10.0 to mount a video whish must display the original clip date-time.
    I have found a timecode generator, a free TimeDate generators by RippleTraining but no one to simply print the *original* clip date time, as well as I can see on my Video-Cam simply pressing a button. I need to show that date-time (as Fri, April 14th 2014 - 11:19:59 a.m.) changing in real time, exacly as in a video-surveillance movie, because of legal reasons.
    Any idea?

    You can have a custom table where u can store date-time of search, and can track, accordingly by order by clause to get the last search date-time.
    --Mukul                                                                                                                                                                                                                                                                                                                                               

  • How do I stop auto update of date/time

    Hi,
    I'm starting to despair, a while ago I stupidly clicked on auto update/time on a letter I was working on, it seemed like a good idea at the time. But now whenever I open any letter the date is automatically updated which is a major problem as I am losing the references to when I actually wrote and therefore sent these letters. I'm too scared to open letters now because I'll lose this important piece of information.
    Any help appreciated!
    Thanks
    Nathalie

    Next time, don't use the Pages 's insert date_time feature.
    Use the one delivered in the free WordService from Devon Technologies.
    It always inserts a fixed date_time.
    But I have wondering about your problem.
    The Pages User Guide states:
    • To add and format the date and time, place the insertion point where you want the value to appear, and then choose Insert > Date & Time.
    To change the date and time format, Control-click the date and time value, choose Edit Date & Time, and then choose a date and time format from the pop-up menu. *If you want the document to always show the current date and time, select “Automatically update on open.”*
    Which, if I understand well means that the default setting is that the inserted date_time is a frozen (fixed) one.
    Yvan KOENIG (VALLAURIS, France) mardi 30 mars 2010 16:29:17

  • Updating EXIF date/time in XML files (Bridge CS4)

    Is there a way to re-read the EXIF date/time information from RAW camera files and update that existing information in the XML files?

    To my knowledge not with Bridge, maybe with a script.
    Basically the problem occurs while using multiple camera's that have not all the same correct date and time. To my experience the quickest way is to bite the bullet once and using the filters for date time for each dslr and apply labels to each dslr, then manual select the correct sequence and rename the whole bunch with a sequence number in front of all the filenames so you can use filename to sort the correct order.
    And after this of course check next time all date and time settings before starting a new job :-)

  • Auto display the last data in array

    How can I auto display the new data in array without the scroll bar?

    If i understand you, you want show last data of array.
    You have use property node: IndexVals. You write there indexes of array frome there you want show the data.

  • How to find out the last date & time on which a program has been run

    Hi Experts,
    Can anybody tell how to find out the last date on which a purticular program has been run.
    Valuable answers will be rewarded.
    Thanks & Regards,
    Satish.

    Hi!
    Try STAD transaction. Unfortunately it contains a huge amount of data, so it is available only for a few days backwards... Maybe some weeks, but you can't make yearly reports from its data... So it's not useful to see, which program is in use or not...
    I planned once to download it weekly, but it was not so important...
    Regards
    Tamá

  • Update file date/time stamp using java

    Let me explain you what I am going through:-
    I have created a java based installer using Jexpress tool and after I do the installation of my files, the files takes the current date rather then taking the date when it was created or modified.
    Everything goes into JAR and I heard that Jar file do not retain the date/time stamp of the file.
    I would like to know if we can change the date and time stamp of the files using Java.
    Is there any method to do that or can we do this by writing the java class?
    Thank You
    Mehul

    Did you check it?
    I did.
    $ jar cvf ~/ui *.m3u
    added manifest
    adding: Amollhgv.m3u(in = 42) (out= 24)(deflated 42%)
    adding: Brand1.m3u(in = 56) (out= 27)(deflated 51%)
    adding: Brand2.m3u(in = 42) (out= 24)(deflated 42%)
    adding: Brand3.m3u(in = 42) (out= 24)(deflated 42%)
    adding: Brand4.m3u(in = 42) (out= 24)(deflated 42%)
    adding: Brand5.m3u(in = 42) (out= 24)(deflated 42%)
    adding: Brand6.m3u(in = 42) (out= 24)(deflated 42%)
    adding: Edurhgv.m3u(in = 42) (out= 24)(deflated 42%)
    $ unzip -l ~/ui
    Archive:  /home/ijbalazs/ui
      Length     Date   Time    Name
            0  12-04-03 17:53   META-INF/
           71  12-04-03 17:53   META-INF/MANIFEST.MF
           42  08-26-02 01:03   Amollhgv.m3u
           56  11-22-98 01:15   Brand1.m3u
           42  08-26-02 01:04   Brand2.m3u
           42  08-26-02 01:04   Brand3.m3u
           42  08-26-02 01:04   Brand4.m3u
           42  08-26-02 01:04   Brand5.m3u
           42  08-26-02 01:04   Brand6.m3u
           42  08-26-02 01:04   Edurhgv.m3u
          421                   10 files

  • Date/Time Field in Access 2000 - INSERT INTO ... syntax error

    I am using Labview 6.1 Professional with the Database Connectivity Toolkit. When I execute this SQL Command "INSERT INTO PRODUCTION (Part, Passed, Date) VALUES ('Part#1', 2, '10/10/2003 10:10:10 AM')" I get a Run-Time Syntax Error. If I remove the Date Label and Date Value it works. What is the proper Format of the Date/Time Type Field in ACCESS 2000 for Labview 6.1 SQL? I have seen and tried all of the solutions already posted like MSG 1ZNAJHJ6.

    Well, if it's any consolation handling dates is a pain regardless of which database you use. In any case, I created a table with the following definition:
    CREATE TABLE testing
    (item1 INTEGER,
    item2 DATE)
    I them did the following insert:
    INSERT INTO testing
    VALUES (1, '18/11/1953 04:20:00');
    And everything worked fine. Note that in the date (my Bday, BTW) the format is DD/MM/YYYY followed by the time.
    What exactly is the error you're getting? Can you post the exact text of the error message. Also, I ran my test using the examples that come with LabSQL--not the toolkit.
    Mike...
    Oops, just noticed something. You have a column name that is probibly a reserved word "Date". Try your insert as:
    INSERT INTO PRODUCTION
    VALUES
    ('Part#1', 2, '10/10/2003 10:10:10 AM')
    If there is only those three columns and they the order the data appears is the same as the column order, you don't need the column list. If this works (and it should--I just tried it) I would only view it as a temporary patch. The column name should be changed.
    This is also a good reason to not use the Access GUI to create tables. If you tried creating a table like that in SQL you would have gotten an error message. Learning to build tables in SQL code isn't hard and it adds an extra layer of error checking that the GUI apparently doesn't think is important.
    If you're interested let me know and I can send you the info on a really good book on SQL...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • SAP Script need to display main window two times on single page.

    Hello Guru's,
    So here is my requirement, we need to print check. We are using F110_PRENUM_CHCK and linked with driver prog RFFOUS_C. We have Letter size paper with three sections,
    1. Check
    2. Voucher Section (containing table of element 515, 525 and 530) 515: Heading, 525 : Regup-Belnr, Regup-XBLNR, Regud-Wrbtr.
                                                                                    530: Regup-SGTXT
    3. Voucher Section (As a receipt for bank itself) : contains same data as 2nd section.
    I tried several things reading all the previous post over here in SDN.
    1. Created Z form created two instances of main window it results just single display of table (voucher section) in section two and not in third.
    2. I also tried pasting two times same code in single main window which gives only last item line for the table.
    3. Created z driver program made changes in Write_form added control form for element 515 that does results in showing element 515 on both the location.
                CALL FUNCTION 'CONTROL_FORM'
                  EXPORTING
                    command   = 'NEW-WINDOW'
                  EXCEPTIONS
                    unopened  = 1
                    unstarted = 2
                    OTHERS    = 3.
                CALL FUNCTION 'WRITE_FORM'
                  EXPORTING
                    element = '515'
                  EXCEPTIONS
                    window  = 1
                    element = 2.
    3. For Element 525 and element 530 is not acting same. In the prog 525 = hlp_ep_element. And there are many write_form for this. I tried pasting each and every place same kind of code. It doesnt work. what it do it gives me three pages of output repeating every thing twice and weirdly.
    I am need this to be done as I already took so much time solving nothing is working.
    Please give me the exact location where to paste this code so I can have two times data of main window.
    Or is there any other way to do this....Any way will be good for me as long as it shows two times data in the form.
    The data is table.

    Hi Manju,
    I create a new window (no main) but does not run, please can you tell me what should I do to make it work.
    Best regards.
    Robert.

  • Condition exch.rate KOMV-KKURS needs to be updated at the time of billing.

    Hi All,
    We are in a situation system needs to determine the exchange rate at the time of the billing date.
    We need to set it up for delivery-based billing process.
    I want to mention some important details:
    1- Sales order document currency is local curr. but prices are maintained in EUR in VK11.
    Because of that
             Exchange Rate for Price Determination = 1 ,  (KOMP-KURSK)              
             Price cond ex.rate for conversion to local currency = 2,1      (KOMV-KKURS)
    2- The VTFL configuration is
            Pricing Type = G     Copy pricing elements unchanged and redetermine taxes
            PricingExchRate type = C     Exchange rate determination according to billing date
    3- Billing date = PGI date always.
    Now at the time of the billing (Consider 2 days later after order creation) my expectation is  Price cond ex.rate =2,2 because of system has new ex.rate like 2,2.
    Actually Price cond ex.rate is updated when I set pricing date same as billing date manually and update prices with "B Carry out new pricing" but in that case price is changed as well because the price can be diffrent from at time of the billing rather then at the time of the order creation. I need to update only Price cond ex.rate.
    Any suggestions ?  (Maybe I can create a new pricing type only updates ex.rates can anybody guide me how I can handle that ?)
    Edited by: Goksu Firat on Mar 23, 2010 3:49 PM

    Hi,
    I had a similar problem, but in your case If you need put the exchange rate as new rate of the billing, you should set PricingExchRate type = E in copy control.
    If you need that the exchange rate will be the same of delivery, set the option Price source like D . If you don't use a pricing in delivery try set it too and make tests.
    Att,
    Henrique

Maybe you are looking for