Skip to main content
Question

1 Button to update fields in two apps

  • April 30, 2020
  • 0 replies
  • 82 views

Forum|alt.badge.img+9
I successfully created a button that updates fields in App2 from App1 but am wondering if I can also use this same button to update fields in App1.   i.e. can a 2nd URLRoot statement be added to this for App1?

Thanks!

var text URL = URLRoot() & "db/" & "App2ID" & "?act=API_EditRecord&rid=" & [App2Record ID]
& "&_fid_994=" & Now()
& "&_fid_992=Note from " & UserToName(User())
& "&apptoken=xxxxxxxxxxxxxxx";

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

------------------------------
Christine White
------------------------------
This topic has been closed for replies.

MarkShnierYou
Forum|alt.badge.img+22
  • Quickbase Alumni
  • April 30, 2020
There may be Syntax which exists to do multiple API calls and refresh the page, but if so, the syntax is brutally confusing.

This Syntax is simpler to next successive calls but has the disadvantage that the last step needs to be to land the user on a record or a report, meaning that the same button cannot be used on a record and a random report.

$URLONE
& "&rdr=" & URLEncode($URLTWO)
& URLEncode("&rdr=" & URLEncode($URLTHREE))
& URLEncode(URLEncode("&rdr=" & URLEncode($URLFOUR)))
& URLEncode(URLEncode(URLEncode("&rdr=" & URLEncode($URLFIVE))))
& URLEncode(URLEncode(URLEncode(URLEncode("&rdr=" & URLEncode($URLSIX)))))
& URLEncode(URLEncode(URLEncode(URLEncode(URLEncode("&rdr=" & URLEncode($URLSEVEN))))))



So in you case you need three slices off that salami

var text URLONE = URLRoot() & "db/" & "App2ID" & "?act=API_EditRecord&rid=" & [App2Record ID]
& "&_fid_994=" & Now()
& "&_fid_992=Note from " & UserToName(User())
& "&apptoken=xxxxxxxxxxxxxxx";

var text URLTWO = URLRoot() & "db/" & "App1ID" & "?act=API_EditRecord&rid=" & [App2Record ID]
do something else
& "&apptoken=xxxxxxxxxxxxxxx";

var text URLTHREE = URLRoot(0 & "db/" & dbid() & "?a=dr&rid=" & [Record ID#];

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


The Product Managers at Quick Base are aware that doing all this stuff is not really "no code low code" and there are plans on the Product Roadmap in the medium term to allow us to execute APIs, hopefully successive APIs,  and refresh the screen without the use of javascript.  The don't like us using Javascript as its a security loophole, but they also realize they need ot provide an alternative.





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