Forum Discussion

EOMDevelepors's avatar
EOMDevelepors
Qrew Captain
4 years ago

Button in mobile

I have a button that adds a record in a child table and reloads the page. Since it includes javascript syntax, it would not work in mobile site. Can someone help me re-write this in a way it should work in mobile or it's not possible? 

Here is the code:

If([Amount of open clock-ins]>0,"javascript:alert('You are already clocked in!')",

var text url=
URLRoot() & "db/" & [_DBID_TIME_IN_OUT] & "?a=API_AddRecord&apptoken=[mytokan]&_fid_10=" & URLEncode ([Record ID#])&"&_fid_8=In";

"javascript:" &
"$.get('" &
$url &
"',function(){" &
"location.reload();"&
"});" &
"void(0);")

Thanks

------------------------------
EOM Develepors
------------------------------

9 Replies

  • Not tested recently but you can try this

    var text url=ONE
    URLRoot() & "db/" & [_DBID_TIME_IN_OUT] & "?a=API_AddRecord&apptoken=[mytokan]&_fid_10=" & URLEncode ([Record ID#])&"&_fid_8=In";

    var text URLTWO = the url that you want to land the user on.;

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


    let me know if that works.

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------
    • EOMDevelepors's avatar
      EOMDevelepors
      Qrew Captain
      Thanks Mark. What would I put in to land the user to the current page I called this button from?

      Thanks

      ------------------------------
      EOM Develepors
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend
        What do you mean by "page"  Do you mean a record?  The alternate format cannot refresh a random page, it has to redirect the user to a dashboard or a record or a report.

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