Forum Discussion

QuintenQuinten's avatar
QuintenQuinten
Qrew Assistant Captain
7 years ago

Button won't redirect back to Record in Application

I have a button in a record in Table 1 that creates a new record in a new table (Table 2), in a different application. When I click save in Table 2, it doesn't redirect me back to the record in Table 1. My code is below. I have check a lot of the forums and I'm almost positive my code is right. 

URLRoot() & "db/bkxq4vvkf?a=API_GenAddRecordForm&_fid_126=" & URLEncode ([Record ID#])& "&_fid_23=" & URLEncode(UserToName(User())) & "&dfid=10" & "&z=" & Rurl()

6 Replies

  • You could try this

    var text ADD = URLRoot() & "db/bkxq4vvkf?a=API_GenAddRecordForm&_fid_126=" & [Record ID#]
    & "&_fid_23=" & URLEncode(UserToName(User()))
    & "&dfid=10;


    var text Return = urlroot() & "db/" & dbid() & "?a=dr&rid=" & [Record ID#]

    $ADD
    & "&NextURL=" & URLEncode(Return)
  • QuintenQuinten's avatar
    QuintenQuinten
    Qrew Assistant Captain
    I am getting an error stating that I need to add a semicolon. The "db/" of the second variable all the way to the end of the code is underlined in the error. I did add a semicolon at the end of [Record ID#] but that didn't fix it. 


    var text ADD = URLRoot() & "db/bkxq4vvkf?a=API_GenAddRecordForm&_fid_126=" & [Record ID#]
    & "&_fid_23=" & URLEncode(UserToName(User())) 
    & "&dfid=10;


    var text RETURN = URLRoot() & "db/" & dbid() & "?a=dr&rid=" & [Record ID#];

    $ADD
    & "&NextURL=" & URLEncode(RETURN)
  • Try this. I added a closing quote st the end of the first formula variable

    var text ADD = URLRoot() & "db/bkxq4vvkf?a=API_GenAddRecordForm&_fid_126=" & [Record ID#]
    & "&_fid_23=" & URLEncode(UserToName(User()))
    & "&dfid=10";

    var text RETURN = URLRoot() & "db/" & dbid() & "?a=dr&rid=" & [Record ID#];

    $ADD
    & "&NextURL=" & URLEncode(RETURN)
  • QuintenQuinten's avatar
    QuintenQuinten
    Qrew Assistant Captain
    That fixed one of the errors. I am now getting "The argument list of the function RETURN must begin with a left parenthesis." Not sure what to do with that.
  • Corrected

    var text ADD = URLRoot() & "db/bkxq4vvkf?a=API_GenAddRecordForm&_fid_126=" & [Record ID#]
    & "&_fid_23=" & URLEncode(UserToName(User()))
    & "&dfid=10";

    var text RETURN = URLRoot() & "db/" & dbid() & "?a=dr&rid=" & [Record ID#];

    $ADD
    & "&NextURL=" & URLEncode($RETURN)

    The formula variable RETURN needs a $ in front of it