Know when record is opened

I have several users that will be updating records using Apex. It is my understanding and through testing that there is not easy way to LOCK a record. So I thought the easiest solution would be to let the user know when the record has been opened by someone. This would tell them to pick another record to update.
I created a column in the table called LOCK_DATE. I created a Before Header Process that places the SYSDATE into this column. This works. I needed to clear out the date when the user exits the record.
I created a Process - After Submit and Validations to set this column to null. This seems to work when the user hits Apply. But when the user hits Cancel the Process is not kick off (because the user did not submit anything).
So, I can not figure out how to set this column to null when the user presses Cancel.
First question is am I on the right track? If so, how can I get this to work.
Second question, am I totally doing this wrong and there is a simplier way to do this.
Thanks in advance.

We do understand what you're trying to do. We just advise you not to. It's not realistic on a web application.
BUT, to answer your question, easy, change the cancel button to submit the page instead of doing a redirect (change the Action). I would set "Execute Validations" to no also so that it's truly a cancel.
Then make sure your process that clears the lock date fires when the cancel button is pressed.
You may or may not need a specific branch back to the report.
Here's the one of the big problems with this. If that lock_date field is part of that table you just modified the record. This will give you some unexpected results due to the optimistic locking.
Big problem #2... what if the user just closes the browser? or leaves it open and their session times out? or the power goes out while they are looking at the record? etc... etc.. etc...
Now the record will show as locked forever (or until someone hits the cancel button again I suppose) unless you clean those up regularly.
This is just a bad plan for a web application.
Hope this makes sense.
Thanks
-Jorge

Similar Messages

  • Detect when context menu opens or closes

    Is there an easy way to detect when a (righ-click) context
    menu is visible? I wish there was a "visible" property for the
    Contextmenu class, but there isn't one.
    I've tried to listen to events to know when the menu opens or
    closes but it would seem as though there are far too many
    (undocumented) events to take into account and some of the events
    may be OS specific.
    For example, the following 3 events cover much of the
    scenarios of when the menu opens/closes...
    cmMenu.addEventListener(ContextMenuEvent.MENU_SELECT,
    onShow);
    cmMenu.addEventListener(Event.DEACTIVATE, onHide);
    stage.addEventListener(MouseEvent.MOUSE_DOWN, onHide);
    But you can also click either the f10, alt, esc, or enter
    keys to also close the menu. There could be other ways to close the
    menu, but since it is not well documented, I can't be certain.
    Too bad Event.CLOSE isn't dispatched when the menu closes.
    If anyone knows of a resource that documents how to determine
    when a context menu is opened or closed, please let me know.
    thanks! :-)

    Hello,
    I'm also having problems with this topic.  I'm developing an AIR app that uses context menus, and I've noticed that if I bring up a context menu, mouse around it and highlight items, but DON'T select them (i.e. click off to close the menu) that the main application loses focus.  There seems to be an invisible window or something blocking mouse events, until I move the app or do a command-~ (I'm on a Mac...it's as if there are multiple open windows and this toggles them.)  Note that this only seems to happen in the exact sequence above - selecting an item or avoiding the items altogether after the menu pops up results in the correct (expected) behavior when the menu closes.
    I'd like to be able to catch a close event of some kind for the context menu, and even better, find a way to prevent the problem described above.
    Below is a very simple AIR app that will demonstrate the problem. (I'm compiling with Flex 3.4.1 framework and running it on Snow Leopard...)  Much thanks in advance to anyone who can help me with this problem!
    -Chris
    <mx:WindowedApplication layout="absolute" applicationComplete="init()"
    xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:Script>
    <![CDATA[
    private function init():void {
    // Listener to trace mouseX property
    myCanvas.addEventListener(MouseEvent.MOUSE_MOVE,
    function (e:MouseEvent):void {
    trace(myCanvas.mouseX);
    // Create a simple context menu
    myCanvas.contextMenu= new ContextMenu();
    myCanvas.contextMenu.addItem(new NativeMenuItem("test"));
    ]]>
    </mx:Script>
    <mx:Canvas id="myCanvas" height="50%" width="50%" backgroundColor="0x00FF00"/>
    </mx:WindowedApplication>

  • I downloaded an update for my Safari web browser to "snow leopard". When I click on the .dmg file, a window opens up with a .pkg file but when I click on the .pkg file I get a prompt saying that it doesn't know what program to open it with. with a

    I downloaded an update for my Safari web browser to "snow leopard". When I click on the .dmg file, a window opens up with a .pkg file but when I click on the .pkg file I get a prompt saying that it doesn't know what program to open it with.

    I suspect if you're trying to open a file in 08 that's been opened in 09 the file has been updated to 09 and will not open in 08.

  • Lightroom 4 crashes when trying to open the slideshow module. I spent over three hours with both Adobe and Apple tech support and we know it is a permission issue but have not been able to get it solved.  It started with the last upgrade to 10.8

    Lightroom 4 crashes when trying to open the slideshow module. I spent over three hours with both Adobe and Apple tech support and we know it is a permission issue but have not been able to get it solved.  It started with the last upgrade to 10.8

    Back up all data.
    This procedure will unlock all your user files (not system files) and reset their ownership and access-control lists to the default. If you've set special values for those attributes on any of your files, they will be reverted. In that case, either stop here, or be prepared to recreate the settings if necessary. Do so only after verifying that those settings didn't cause the problem. If none of this is meaningful to you, you don't need to worry about it.
    Step 1
    If you have more than one user account, and the one in question is not an administrator account, then temporarily promote it to administrator status in the Users & Groups preference pane. To do that, unlock the preference pane using the credentials of an administrator, check the box marked Allow user to administer this computer, then reboot. You can demote the problem account back to standard status when this step has been completed.
    Triple-click the following line to select it. Copy the selected text to the Clipboard (command-C):
    { sudo chflags -R nouchg,nouappnd ~ $TMPDIR.. ; sudo chown -Rh $UID:staff ~ $_ ; sudo chmod -R u+rwX ~ $_ ; chmod -R -N ~ $_ ; } 2> /dev/null
    Launch the Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Paste into the Terminal window (command-V). You'll be prompted for your login password, which won't be displayed when you type it. You may get a one-time warning not to screw up. If you don’t have a login password, you’ll need to set one before you can run the command. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator.
    The command will take a noticeable amount of time to run. Wait for a new line ending in a dollar sign (“$”) to appear, then quit Terminal.
    Step 2 (optional)
    The first step should give you usable permissions in your home folder. This step will restore special attributes set by OS X on some user folders to protect them from unintended deletion or renaming. You can skip this step if you don't consider that protection to be necessary.
    Boot into Recovery by holding down the key combination command-R at startup. Release the keys when you see a gray screen with a spinning dial.
    When the OS X Utilities screen appears, select
    Utilities ▹ Terminal
    from the menu bar. A Terminal window will open.
    In the Terminal window, type this:
    resetpassword
    That's one word, all lower case, with no spaces. Then press return. A Reset Password window will open. You’re not  going to reset a password.
    Select your boot volume ("Macintosh HD," unless you gave it a different name) if not already selected.
    Select your username from the menu labeled Select the user account if not already selected.
    Under Reset Home Directory Permissions and ACLs, click the Reset button.
    Select
     ▹ Restart
    from the menu bar.

  • WhenI close firefox, and later when I try to open firefox again, it says it is already open, although it shows to be closed---don't know when it is closed or not, don't like this

    When I close firefox, it closes, then later when I try to open firefox again a message opens and says firefox is already running, ---have to open task manager to close firefox before it will open again, browser may have been open for hours and didn't show to be---why does this happen, don't know when firefox closes or not------

    https://support.mozilla.com/en-US/kb/Firefox+hangs#Hang_at_exit

  • HT1451 If I have two iTunes libraries on one computer, how do I know which one is opening when I click on the iTunes icon on the desktop?

    If I have two or more iTunes Libraries on one computer, how do I know which one is opening when I click on the iTunes icon on my desktop?

    You cannot.
    When you sync to a new library, it will erase the current content.
    Use your backup copy of the old computer to copy everything to the new one.

  • I like to know when i use fire fox why it take so much resource of my computer ? it almost 1/4 of my 4gig of memeory , ihave 6,7 page of firefox window open

    i like to know when i use fire fox why it take so much resource of my computer ? it almost 1/4 of my 4 gig of memory , i have 6,-8 page of firefox window open at cpu level its is almost 25% been used up. i see its taking too much resource i wonder why ?? how not to take so much and it crashes often.. any help,ive 24.0 ,

    Firefox add-ons take some memory. This amount varies depending on the add-on.
    '''Try Firefox Safe Mode''' to see if the problem goes away. Safe Mode is a troubleshooting mode, which disables most add-ons.
    ''(If you're not using it, switch to the Default theme.)''
    * On Windows you can open Firefox 4.0+ in Safe Mode by holding the '''Shift''' key when you open the Firefox desktop or Start menu shortcut.
    * On Mac you can open Firefox 4.0+ in Safe Mode by holding the '''option''' key while starting Firefox.
    * On Linux you can open Firefox 4.0+ in Safe Mode by quitting Firefox and then going to your Terminal and running: firefox -safe-mode (you may need to specify the Firefox installation path e.g. /usr/lib/firefox)
    * Or open the Help menu and click on the '''Restart with Add-ons Disabled...''' menu item while Firefox is running.
    [[Image:FirefoxSafeMode|width=520]]
    ''Once you get the pop-up, just select "'Start in Safe Mode"''
    [[Image:Safe Mode Fx 15 - Win]]
    '''''If the issue is not present in Firefox Safe Mode''''', your problem is probably caused by an extension, and you need to figure out which one. Please follow the [[Troubleshooting extensions and themes]] article for that.
    ''To exit the Firefox Safe Mode, just close Firefox and wait a few seconds before opening Firefox for normal use again.''
    Does this decrease the memory usage? Please report back soon.

  • How InDesign comes to know about any changes on document, but not saved. As it shows * on the name of document when it is opened and any changes. And after saving * symbol is get removed from the name of document. How and where indesign@ handles this?

    How InDesign comes to know about any changes on document, but not saved. As it shows * on the name of document when it is opened and any changes.
    And after saving * symbol is get removed from the name of document. How and where indesign@ handles this?

    Are you just asking because you want to know, or do you have a problem you need to solve? I don't know how to write a program, but I think what your are describing is not an unusual thing for a  program to do. The * tells you that changes have been made since the last save, and the program reserves a portion of memory for undo functions. I suppose a coder could tell you how it works, but I don't think it would help an average user to know, but that's just my opinion.

  • Does anyone know what Error: 5 mean when trying to open up InDesign CS4

    Does anyone know what Error: 5 mean when trying to open up InDesign CS4?

    Opening the program, or opening a file?

  • How i know when a EXECUTE_QUERY retrieved last record

    Hi...
    How i know when the EXECUTE QUERY retrieved the last record in a block ....?
    Exist a trigger after trigger POST-QUERY?
    Regards
    Hector Gabriel Ulloa Ligarius
    Santiago of Chile
    http://es.groups.yahoo.com/group/desarrolloOracle/

    Kevin, sorry
    But the :system.last_record not change the value during the execution of EXECUTE_QUERY.
    Only useful when the data was retrieved into blocks...not during..
    Other mode?
    Regards
    Hector Gabriel Ulloa Ligarius
    Santiago of Chile
    http://es.groups.yahoo.com/group/desarrolloOracle/

  • Anyone knows when will Lightroom be able to open Raw files from the new Nikon D810? Thanks.

    Anyone knows when will Lightroom be able to open Raw files from the new Nikon D810 camera? Thanks.

    Just posted to Lightroom Journal Lightroom Journal | Tips and advice straight from the Lightroom team. It's not Lightroom, but does address the original question. Definitely worth a look, sooner rather than later.
    Adobe Photoshop Camera Raw 8.6 RC for CC and CC 2014 Release Candidate | digital camera raw file support - Adobe Labs
    I expect Lightroom will follow in due course, but have not ETA

  • HT2476 I have just downloaded Mountain Lion for my MacBook Pro and now when my applications open they close and the error "This has just quit unexpectedly" message pops up. Does anybody know what is happening?

    I have just downloaded Mountain Lion for my MacBook Pro and now when my applications open they close and the error "This has just quit unexpectedly" message pops up. Does anybody know what is happening/how to fix it?

    Welcome to Apple Communities
    Press Command and R keys in boot and reinstall

  • When I am opening photoshop elements 10 I see my desktop picture into photoshop elements 10 ans I don't know how to avoid that

    when I am opening photoshop elements 10 I see my desktop picture into photoshop elements 1- and I don't know how to avoid that. Does anybody know I can get rid of that picture, so that I only see the workspace of Elements?
    Thanks a lot

    What I said--go to the Window menu and turn on the application frame.

  • How to populate only the first record by default when the page opens?

    Dear Members,
    I am using OAF R12 and my requirement is as follows:-
    When the user opens the custom OAF R12 page, I just want to query the first record from the underlying VO.
    For example, If the table has 10 rows, I just want to query the first row as soon as the page opens.
    I have written the below code:-
    Process Request Method of the CO:-_
    am.invokeMethod("initHeaders");
    Code in AM_
    public void initHeaders()
    HeadersVOImpl hVO = getHeadersVO1();
    hVO.initQueryHeaders();
    Code in VO_
    public void initQueryHeaders()
    executeQuery();
    As it is very clear that with the above code all the records will be queried. I have to add something before the executeQuery() method in the VO to just query the first record.
    Can any one please help me by guiding me what I should add before the executeQuery() method in the VO?
    Many thanks in advance.
    Regards,
    R4S.

    Hello Gyan,
    Many thanks for your reply.
    The below line in your code is throwing incompatible type error:
    OARow row = vo.first();
    Can you please help me.
    Regards,
    R4S

  • I would like to know when the slow motion video recording will come in 5c. in which update u will release it.

    Dear sir ,
    i would like to know when the slow motion video recording will come in 5c. in which update u will release it.

    I'm afraid the processor in the iPhone 5c does not support that feature. Since you can't change the hardware setup inside the phone, this will probably not be introduced at all for this model.

Maybe you are looking for