PrashantMaheshw
4 years agoQrew Captain
Re: API button to add new parent record
APIGods still are needed to resolve this, but some progress
I correct myself , I don't know how to achieve 4 as I've read at multiple place %%rid%% doesn't like to be URLEncoded in anyways,
var text rd="%%rid%%";
// Assuming you start from child record, This URL is to come back to the child and edit edit to enter parent id
var text urltwo=URLRoot()&"db/" &Dbid()& "?a=API_EditRecord"
//& "&_fid_8="&$rd --> This keeps failing as we cannot Record ID of parent , but works for any other field
& "&rid="&[Record ID#]
// This URL takes you to parent table and creates a new record, notice the dbid is hardcoded . The part which works
URLRoot()&"db/"&"bsguktwqs"&"?a=API_AddRecord"& "&_fid_6=Gobaby"
& "&rdr="&
// Next URL BEGINS to go child and edit
URLEncode($urltwo)
// Last URL with two encodes to come back to child ID after editing it back
& URLEncode("&rdr="&URLEncode(URLRoot() & "db/"&Dbid()& "?a=doredirect&z=" & Rurl()))
------------------------------
Prashant Maheshwari
------------------------------
I correct myself , I don't know how to achieve 4 as I've read at multiple place %%rid%% doesn't like to be URLEncoded in anyways,
- Below code creates a child
- Comes back to child , edits it . Please see notes with start with //
- Returns back to child record
- AppToken were disabled during my testing, you need to enable these
var text rd="%%rid%%";
// Assuming you start from child record, This URL is to come back to the child and edit edit to enter parent id
var text urltwo=URLRoot()&"db/" &Dbid()& "?a=API_EditRecord"
//& "&_fid_8="&$rd --> This keeps failing as we cannot Record ID of parent , but works for any other field
& "&rid="&[Record ID#]
// This URL takes you to parent table and creates a new record, notice the dbid is hardcoded . The part which works
URLRoot()&"db/"&"bsguktwqs"&"?a=API_AddRecord"& "&_fid_6=Gobaby"
& "&rdr="&
// Next URL BEGINS to go child and edit
URLEncode($urltwo)
// Last URL with two encodes to come back to child ID after editing it back
& URLEncode("&rdr="&URLEncode(URLRoot() & "db/"&Dbid()& "?a=doredirect&z=" & Rurl()))
------------------------------
Prashant Maheshwari
------------------------------