Alpha Video Training
Results 1 to 2 of 2

Thread: Conditional CurrentForm.Redirect Syntax Issue

  1. #1
    Member
    Real Name
    Robert Neil
    Join Date
    Nov 2008
    Posts
    41

    Default Conditional CurrentForm.Redirect Syntax Issue

    I would like to add an If then statement to my aftervalidate event. I want it to evaluate a control named Last_Record and depending on the value perform the appropriate redirect. Can this be done?

    Here is what I have tried so far:

    t = table.open("[pathalias.adb_path]\safetyroundfindings")
    t.enter_begin()
    t.Tour_id=(CurrentForm.Controls.Tour_Id.value)
    t.Tourd_id=alltrim(CurrentForm.Controls.Tourd_id.value)
    t.enter_end()
    t.close()

    If(CurrentForm.Controls.Last_Record.value="Yes",CurrentForm.RedirectTarget="dashboard.a5w",CurrentForm.RedirectTarget="newsafetyrounddetails.a5w?Tour_id="+CurrentForm.controls.Tour_id.value)

    *******AND********

    t = table.open("[pathalias.adb_path]\safetyroundfindings")
    t.enter_begin()
    t.Tour_id=(CurrentForm.Controls.Tour_Id.value)
    t.Tourd_id=alltrim(CurrentForm.Controls.Tourd_id.value)
    t.enter_end()
    t.close()

    iif(CurrentForm.Controls.Last_Record=.T.,CurrentForm.RedirectTarget="dashboard.a5w",CurrentForm.RedirectTarget="newsafetyrounddetails.a5w?Tour_id="+CurrentForm.controls.Tour_id.value)

    *******AND********

    If CurrentForm.Controls.Last_Record.value="No"then
    CurrentForm.RedirectTarget="newsafetyrounddetails.a5w?Tour_id="+CurrentForm.controls.Tour_id.value
    else
    CurrentForm.RedirectTarget="dashboard.a5w"
    end if

  2. #2
    Member
    Real Name
    Robert Neil
    Join Date
    Nov 2008
    Posts
    41

    Default Re: Conditional CurrentForm.Redirect Syntax Issue

    Here is what I ended up with. Works Great!

    t = table.open("[pathalias.adb_path]\safetyroundfindings")
    t.enter_begin()
    t.Tour_id=(CurrentForm.Controls.Tour_Id.value)
    t.Tourd_id=alltrim(CurrentForm.Controls.Tourd_id.value)
    t.enter_end()
    t.close()

    If CurrentForm.Controls.Last_Record = "No" then

    CurrentForm.RedirectTarget="newsafetyrounddetails.a5w?Tour_id="+CurrentForm.Controls.Tour_id.value
    Else
    CurrentForm.RedirectTarget="dashboard.a5w"
    End if

Similar Threads

  1. When to use "CurrentForm.Controls...."?
    By Easy Rider in forum Application Server Version 9 - Web/Browser Applications
    Replies: 1
    Last Post: 10-02-2008, 03:43 PM
  2. CurrentForm.controls vs. Request.variables
    By Bill Parker in forum Application Server Version 8
    Replies: 11
    Last Post: 09-15-2008, 10:06 PM
  3. CurrentForm.RedirectTarget
    By nordmann in forum Application Server Version 8
    Replies: 1
    Last Post: 12-06-2007, 12:36 AM
  4. CurrentForm.RedirectTarget to New Window
    By jacklcs in forum Application Server Version 8
    Replies: 1
    Last Post: 09-25-2007, 07:07 AM
  5. Lookup() syntax issue
    By Jeffrey Wolfe in forum Alpha Five Version 5
    Replies: 2
    Last Post: 08-27-2004, 06:17 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
  •