NetTalk Central

Author Topic: Conditional URL on Save  (Read 5316 times)

ianburgess

  • Full Member
  • ***
  • Posts: 119
    • View Profile
    • Email
Conditional URL on Save
« on: June 23, 2012, 12:34:33 AM »
I have a Login form and currently the template had "IndexPage" as the URL on Save. I need to go to a different URL according to who has logged in. How can I set a conditional URL on save?  I tried embedding code to set LOC:Formaction just after the template sets it, but the embed point was too early to take account of the login.

DonRidley

  • Don Ridley
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 729
  • donaldridley2011@gmail.com
    • View Profile
    • Email
Re: Conditional URL on Save
« Reply #1 on: June 23, 2012, 07:18:37 AM »
Use a variable (see screenshot) and place your code here:

SetFormAction  routine
  data
! Start of "Set Form Action"
! [Priority 5000]

! End of "Set Form Action"
  code
  ! Start of "Set Form Action"
  ! [Priority 5000]
  !----------------------->>>>>>>>>>>>>>CODE HERE <<<<<<<<<<<<<<<------------------------------------
  ! End of "Set Form Action"
  loc:FormAction = p_web.GetValue('onsave')
  If loc:formaction = 'stay'
    loc:FormAction = p_web.Requestfilename
  Else
    loc:formaction = 'IndexPage'  !<<<<<<------variable will appear here
  End

[attachment deleted by admin]
« Last Edit: June 23, 2012, 07:22:24 AM by DonRidley »
"Eliminate the impossible, whatever remains, however unlikely, must be the truth."

NetTalk 12.55
Clarion 11

ianburgess

  • Full Member
  • ***
  • Posts: 119
    • View Profile
    • Email
Re: Conditional URL on Save
« Reply #2 on: June 23, 2012, 10:00:33 AM »
Many thanks - I will give that a try.