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
------------------------------
Original Message:
Sent: 06-08-2022 13:15
From: Mark Shnier (YQC)
Subject: Add Child Record, then edit that child record, then redirect to edit form of child record
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
Original Message:
Sent: 06-08-2022 12:55
From: Harrison Smith
Subject: Add Child Record, then edit that child record, then redirect to edit form of child record
I feel like this should be easy but I'm drawing a blank. I have a situation where, when a child record (media) gets created via button, the user has to save the record after making their changes, then edit it again to update 1 last field. This is because that last field needs to be populated with a location path that contains the record ID of the child media record, which doesn't exist yet when they click the button to add the media. So it just creates a few extra clicks that shouldn't really be necessary.
So I'm trying to tweak the button to create the media from the parent (request), then edit that same media record by populating a text field with "some string" & the newly created RID for this child media record. Lastly, after adding & editing the record, I'll have it redirect to the edit form of the media so the user can make their edits as necessary.
------------------------------
Harrison Smith
------------------------------