So, for years now this is one feature that has always eluded me due to the fact that I've never been able to get it to work.
How does one nest multiple API calls in a single button? I've read the old article that talks about "rdr" and such, but the example only shows a single API call which doesn't help. Right now I need this single button to ADD a new record in a specific table, which it does, but then EDIT the parent and then RETURN to the parent in edit mode. This is what I have currently:
var text URLTwo =
URLRoot() & "db/" & [_DBID_TABLENAME] & "?a=API_EditRecord=" & "&apptoken=APPTROKEN"
& (If([THING1]=false, "&_fid_312=false" & "&_fid_304=false",""))
& (If([THING2]=false, "&_fid_36=false" & "&_fid_305=false",""))
& (If([THING3]=false, "&_fid_37=false" & "&_fid_306=false",""));
var text URLOne =
URLRoot() & "db/" &[_DBID_TABLENAME]& "?a=API_AddRecord" & "&apptoken=APPTROKEN"
& "&_fid_6=" & [Record ID#]
& "&_fid_7=" & URLEncode(User())
& "&_fid_8=" & Now()
& "&_fid_9=" & "Returned"
& "&_fid_23=" & $VARIABLE1
& "&_fid_24=" & $VARIABLE2
& "&_fid_25=" & $VARIABLE3 ;
//Return Button
var text ReturnButtonURL =
$URLOne
& URLEncode("&rdr=" & ($URLTwo))
& "&rdr=" & $ReturnURL ;
I've tried every variation I can think of with URLEncode(), but the only thing it does is run the FIRST API call which is API_AddRecord. It runs that, then dumps me at the app's homepage. Not once has it ran the second API_EditRecord call. Again, it ALWAYS creates the required record, but the next steps do nothing.
Any insight on this would be ultra-appreciated.