Alpha Video Training
Results 1 to 3 of 3

Thread: Get MOST RECENT field value on UPDATE new val if there is one, old val if there isnt

  1. #1
    "Certified" Alphaholic
    Real Name
    Scott
    Join Date
    Mar 2010
    Location
    Toronto,ON
    Posts
    1,031

    Default Get MOST RECENT field value on UPDATE new val if there is one, old val if there isnt

    e.rv.v.r_1.fieldname?
    OR something else?

    args.find(fieldname).data only brings back updated fields

    how can i get the most current value for the field?
    e.g if the field was updated - then give me the updated value, else give me the old value

    there must be built in function for this - i dont wanna have to write the logic

  2. #2
    Member StephenP's Avatar
    Real Name
    Stephen Pilon
    Join Date
    Apr 2000
    Location
    Front Royal, Virginia
    Posts
    491

    Default Re: Get MOST RECENT field value on UPDATE new val if there is one, old val if there

    Where I you trying to do this? The e variable should contain what you want, but it holds it in different ways for different types of events, functions, etc.
    Stephen Pilon
    Associate Librarian
    Christendom College

  3. #3
    "Certified" Alphaholic
    Real Name
    Scott
    Join Date
    Mar 2010
    Location
    Toronto,ON
    Posts
    1,031

    Default Re: Get MOST RECENT field value on UPDATE new val if there is one, old val if there

    Sorry - trying to do this in the OnBeforeSQLCommandExecute event.


    there is e.argsXML
    which I can use to say
    dim args as SQL::Arguments
    args.XML=e.argsXML

    I can then use args.Find("name"), but if doesnt find anything - i want to get the old value for the field.
    Example: I need to call a procedure that takes the arguments

    startDate, endDate

    If the user updates the record and changes startDate only - the endDate will not be available in the args object. However, the startDate will (because it was changed).

    I can use e.rv.v.{rownumber}.fieldname or whatever - to retrieve the endDate. However, I can also use e.rv.v.rownumber.fieldname to retrieve the startdate or the end date.

    My question is - why would i need to use the args object?
    What is the best way to retrieve values?

    For example - if the user updates a record, I want to get the startDate and endDate - these could either be updated or not.

    startDate=args.find("start_date").data //but if it wasnt updated - then what should i use e.rv? but if i use e.rv - what if it was updated?

    what is the PROPER way to do this? is there a e.getcurrentvalue(field) that will return the new value if the user has typed one - or the old value if they havent?


    callfunction(startDate,endDate)

Similar Threads

  1. Setting values in parent grid, new values get revert to original values
    By bjacobson in forum Application Server Version 10 - Web/Browser Applications
    Replies: 2
    Last Post: 11-11-2010, 11:53 AM
  2. OnPageRedirect - wait for updated values
    By lgrupido in forum Application Server Version 10 - Web/Browser Applications
    Replies: 0
    Last Post: 10-06-2010, 12:27 PM
  3. Database field values *before* update
    By pruel in forum Archived Wishlist
    Replies: 0
    Last Post: 01-19-2006, 09:13 PM
  4. proper update installation?
    By George Corder in forum Alpha Five Version 4
    Replies: 3
    Last Post: 06-22-2002, 06:10 AM
  5. Update field values
    By Barry Potter in forum Alpha Five Version 4
    Replies: 3
    Last Post: 09-14-2000, 05:29 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •