JasonJohnson2
6 years agoQrew Cadet
Re: Magic Button Question - Changing Appearance after clicking
I used to make rich text buttons that were able to perform different tasks, change colors, and change wording all based on specific criteria. URL formula buttons limit capability at least for me and I didn't like that so I made a decision to use only one type for all buttons so I can always control more. I am a bit rusty and lack time until later this week to put something better together but below is how you can make 2 different API's work on a single button. I am rusty because automations have eliminated those types of buttons for me.
Combine everything together into one statement and wrap it all in an URLEcode like shown below with an rdr added between the commands. You may need to put another URLEncode from the URLRoot until right before the & of the next URLRoot, little foggy on that part. Essentially Quick Base doesn't like doing different API's at the same time out of a formula button unless you do this. I did bolding on my changes.
var text editadd=
URLEcode(URLRoot() & "db/" & Dbid()
& "?act=API_EditRecord&rid=" & [Record ID#]
& "&_fid_183=" & URLEncode(UserToName(User()))
& "&_fid_233=true"
& "&apptoken=......"
& "&rdr="
& URLRoot() & "db/" & [_DBID_TRANSACTIONS]
& "?act=API_AddRecord"
& "&apptoken=....."
& "&_fid_6=" & [Application/Offer Confirmation Date]
& "&_fid_44=" & ([Deal %]*100)
...........
& "&_fid_45=" & Round([Payment],0.01));
------------------------------
Jason Johnson
------------------------------
Combine everything together into one statement and wrap it all in an URLEcode like shown below with an rdr added between the commands. You may need to put another URLEncode from the URLRoot until right before the & of the next URLRoot, little foggy on that part. Essentially Quick Base doesn't like doing different API's at the same time out of a formula button unless you do this. I did bolding on my changes.
var text editadd=
URLEcode(URLRoot() & "db/" & Dbid()
& "?act=API_EditRecord&rid=" & [Record ID#]
& "&_fid_183=" & URLEncode(UserToName(User()))
& "&_fid_233=true"
& "&apptoken=......"
& "&rdr="
& URLRoot() & "db/" & [_DBID_TRANSACTIONS]
& "?act=API_AddRecord"
& "&apptoken=....."
& "&_fid_6=" & [Application/Offer Confirmation Date]
& "&_fid_44=" & ([Deal %]*100)
...........
& "&_fid_45=" & Round([Payment],0.01));
------------------------------
Jason Johnson
------------------------------