Discussions

Expand all | Collapse all

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

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

    Posted 19 days ago
    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
    ------------------------------


  • 2.  RE: Formula URL - To add a new record and update the current record

    Posted 19 days ago
    Can you post your current code?

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



  • 3.  RE: Formula URL - To add a new record and update the current record

    Posted 19 days ago
    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
    ------------------------------



  • 4.  RE: Formula URL - To add a new record and update the current record

    Posted 19 days ago
    Edited by Mark Shnier (YQC) 19 days ago
    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
    ------------------------------