Forum Discussion

AlexGale's avatar
AlexGale
Qrew Captain
7 years ago

How does the ""&z="" function work?

I found a post on here that recommended using "&z="&Rurl() at the end of a GenAddRecord formula in order to, upon saving the opened form, redirect the user back to where they started from. This works great, but I would like to understand what's going on, because these functions seem useful in a variety of situations. 

So the way I think it works is that "&z=" tells the form where to go after the save button is clicked. Does that mean Rurl() is just the url of the record, and I could put any url in there to customize this function? 

Thanks
  • if you use the syntax like

    var text AddRecordForm = ... and put your GenAddRecordForm URL here;

    var text DoSomethingNext = and put your next URL here;

    then you can do this

    $AddRecordForm 
    & "&NextURL=" & URLEncode($DoSomethingNext)
  • The z= .. syntax does something that you cannot replicate in any other way, as far as i know.  For example, if you launch off a report with dynamic filers set to add a record, it will return you to that same report  and preserve the Dynamic filters.
    • AlexGale's avatar
      AlexGale
      Qrew Captain
      So is it only used as z=Rurl? I thought it might be a more flexible option, say if I wanted to redirect to a specific record after a user fills in a GenAddRecord form. 
    • QuickBaseCoachD's avatar
      QuickBaseCoachD
      Qrew Captain
      I don't believe you can mess with that z=rul.  it does what it does in that syntax.  But you can use the NextURL syntax if you know where you want to go to after the record is saved.
    • AlexGale's avatar
      AlexGale
      Qrew Captain
      So I can't, say, take information from the record that is being launched from, and then use that to inform where the user goes after they click the save button? 
  • Funny, that's actually where I got the question from. The article doesn't really go into what exactly "&z="&Rurl() is, just what its most common use cases are. 
  • Ah, I gotcha. 

    Well, the way I read it is that it was introduced as a hack and can only be used in two ways (or really one way that can be arrived at in two ways). 

     

    I wouldn't incorporate it into my stuff outside of the very narrow description offered in that article and probably wouldn't do it even then if I could help it.  Which, apparently I have because I can't recall using it to date.    

    Let me know what you learn though.  You may find some cool stuff.

    Thanks,

    ~Rob
  • Ah well it's still useful even in this one narrow situation I suppose. And I can use the NextUrl thing for other situations. 

    Thanks