Discussions

Expand all | Collapse all

Button won't redirect back to Record in Application

  • 1.  Button won't redirect back to Record in Application

    Posted 08-10-2017 21:17
    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()


  • 2.  RE: Button won't redirect back to Record in Application

    Posted 08-10-2017 21:22
    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)


  • 3.  RE: Button won't redirect back to Record in Application

    Posted 08-11-2017 12:53
    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)


  • 4.  RE: Button won't redirect back to Record in Application

    Posted 08-11-2017 13:27
    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)


  • 5.  RE: Button won't redirect back to Record in Application

    Posted 08-11-2017 17:53
    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.


  • 6.  RE: Button won't redirect back to Record in Application

    Posted 08-12-2017 00:55
    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


  • 7.  RE: Button won't redirect back to Record in Application

    Posted 08-12-2017 15:08
    Perfect! Thanks again!