Forum Discussion
MarkShnier__You
Qrew Legend
You will need to use the Rich Text "Save Before Navigating" syntax to hold of that Newly created Record ID#
https://community.quickbase.com/communities/community-home/digestviewer/viewthread?MessageKey=4466dd0f-403f-4f24-94d8-4ac7128081ae&CommunityKey=d860b0f8-6a48-487b-b346-44c47a19a804&tab=digestviewer#bm4466dd0f-403f-4f24-94d8-4ac7128081ae
------------------------------
Mark Shnier (YQC)
mark.shnier@gmail.com
------------------------------
https://community.quickbase.com/communities/community-home/digestviewer/viewthread?MessageKey=4466dd0f-403f-4f24-94d8-4ac7128081ae&CommunityKey=d860b0f8-6a48-487b-b346-44c47a19a804&tab=digestviewer#bm4466dd0f-403f-4f24-94d8-4ac7128081ae
------------------------------
Mark Shnier (YQC)
mark.shnier@gmail.com
------------------------------
HarrisonSmith
3 years agoQrew Trainee
Thanks Mark, knew you'd have a quick response. Unfortunately I'm getting an error saying "sorry, there is no record in this application table with the record identifier (rid) of "0".
This is the code for my button as it stands now:
var text rid = "%%rid%%";
var text Token = my app token;
var text CreateMedia = URLRoot() & "db/" & [_DBID_MEDIA] & "?a=API_GenAddRecordForm&apptoken=" & $Token & "&_fid_7=" & URLEncode([Record ID#]);
var text UpdateMedia = URLRoot() & "db/" & [_DBID_MEDIA] & "?a=API_EditRecord&apptoken=" & $Token & "&RID=" & $rid & "&_fid_14=testingAddRID" & $rid;
var text URL = $CreateMedia & "&rdr=" & URLEncode($UpdateMedia) & $RID;
"<a class='Vibrant Primary SaveBeforeNavigating' data-replaceRid=true href='" & $url & "'>Add Matter, Update New Matter, Return to Edit New Matter</a>"
------------------------------
Harrison Smith
------------------------------
This is the code for my button as it stands now:
var text rid = "%%rid%%";
var text Token = my app token;
var text CreateMedia = URLRoot() & "db/" & [_DBID_MEDIA] & "?a=API_GenAddRecordForm&apptoken=" & $Token & "&_fid_7=" & URLEncode([Record ID#]);
var text UpdateMedia = URLRoot() & "db/" & [_DBID_MEDIA] & "?a=API_EditRecord&apptoken=" & $Token & "&RID=" & $rid & "&_fid_14=testingAddRID" & $rid;
var text URL = $CreateMedia & "&rdr=" & URLEncode($UpdateMedia) & $RID;
"<a class='Vibrant Primary SaveBeforeNavigating' data-replaceRid=true href='" & $url & "'>Add Matter, Update New Matter, Return to Edit New Matter</a>"
------------------------------
Harrison Smith
------------------------------
- MarkShnier__You3 years agoQrew LegendWhat you want to do is to ADD Media totally normally. Use the usual add child button that Quickbase created for you, but without the "&z=Rurl() part.
Then create a button to on the Media record to show in ADD and Edit mode which you will use instead of the native green SAVE button. Call it like "Save and Continue Editing".
var text RID = IF([Record ID#]>0, [Record ID#], %%RID%%);
var text URL = URLRoot() & "db/" & [_DBID_MEDIA] & "?a=er&rid=" & $RID;
"<a class='Vibrant Primary SaveBeforeNavigating' data-replaceRid=true href='" & $URL & "'>Save and Continue Editing"</a>"
------------------------------
Mark Shnier (YQC)
mark.shnier@gmail.com
------------------------------