Discussions

Expand all | Collapse all

Custom Button handling multiple API/URL

  • 1.  Custom Button handling multiple API/URL

    Posted 08-23-2018 20:35
    I'm attempting to update fields when a button is pressed, and this button also runs a report that is a CSV Export. I've tried this both ways, and I either have one or the other run, but I can never have both execute:

    If([Type]="Time Sheets",URLEncode(URLRoot() & "db/" &Dbid()&"?a=API_EditRecord&rid="&[Record ID#]&"&_fid_46=1&_fid_64="&ToText(User())&"&_fid_66="&Now()&"&rdr="&URLEncode(URLRoot() & "db/bm38ip98v?a=q&qid=36&nv=1&v0=" & [Batch Info])),"")

    Pretty much what I'm trying to do, is Export a CSV based on the current record, and lock that record, which is done by a checkbox, and capture the user and time that export was executed.

    I can get either the field updates to work, but there's no csv, or I can get the csv to work, but fields don't update.


  • 2.  RE: Custom Button handling multiple API/URL

    Posted 08-23-2018 20:40
    Try this syntax. Readability is important to nailing these with fewer syntax errors


    var text URLONE = URLRoot() & "db/" &Dbid()
    & "?a=API_EditRecord&rid=" & [Record ID#]
    & "&_fid_46=1"
    & "&_fid_64=" & ToText(User())
    & "&_fid_66=" &Now();

    var text URLTWO =  URLRoot() & "db/bm38ip98v?a=q&qid=36&nv=1&v0=" & [Batch Info];

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