Forum Discussion

NathanAllan2's avatar
NathanAllan2
Qrew Member
4 years ago

Formula URL - To add a new record and update the current record

I currently have a formula url button that adds a record to table y when I push it with certain fields from that current record in table x. What I need to also be able to do is, update a field of the current record in table x.

Is this possible and what would the syntax look like?

Thanks!

------------------------------
Nathan Allan
------------------------------

3 Replies

    • NathanAllan2's avatar
      NathanAllan2
      Qrew Member
      Yes, here's the current code.

      URLRoot() & "db/" & [_DBID_RENEWALS] & "?a=API_GenAddRecordForm&_fid_108=" & URLEncode ([NAMEID])&"&_fid_9=Yes&_fid_6=" &[OID_Used_For_Key]& "&_fid_42=Pending&_fid_45=" & ToText(User()) & "&z=" & Rurl()

      ------------------------------
      Nathan Allan
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Qrew Champion
        You will need to update the current record first and then redirect to the add record form.  You need to hope that your user does not get abducted by aliens and does have the opportunity to actually Add the record, since it will have been marked as added.

        var text URLONE = URLRoot() & "db/" & dbid() & "?act=API_EditRecord&rid=" & [Record ID]
        & "& "AppToken=xcxcxcxcxcxcxc" // if you have the need for application Tokens enabled
        & "&_fid_99=" & urlencode("new value");

        var text URLTWO = 
        URLRoot() & "db/" & [_DBID_RENEWALS] & "?a=API_GenAddRecordForm&_fid_108=" & URLEncode ([NAMEID])&"&_fid_9=Yes&_fid_6=" &[OID_Used_For_Key]& "&_fid_42=Pending&_fid_45=" & ToText(User()) & "&z=" & Rurl();

        $URLONE
        & "&rdr=" & URLEncode($URLTWO)



        If there is any syntax errors that you cannot debug please post back with your formula and the error.

        ------------------------------
        Mark Shnier (YQC)
        Quick Base Solution Provider
        Your Quick Base Coach
        http://QuickBaseCoach.com
        mark.shnier@gmail.com
        ------------------------------