This was the code when I was just trying to get it to work in the same table (this said no record found, and doesnt even perform the add record):
var text RID = "%%rid%%";
var text AddRecord = URLRoot() & "db/" & Dbid() & "?a=nwr";
var text EditRecord = URLRoot() & "db/" & Dbid() & "?a=er&rid=" ;
var text URL =
$AddRecord
& "&rdr=" & URLEncode($EditRecord) & $RID;
"<a class='SaveBeforeNavigating' data-replaceRid=true style=\"text-decoration:none; background: #4b7097; border-radius: 5px; color: #ffffff; display: inline-block; padding: 0px 0px 0px 0px; width:100px; text-align: center; text-shadow: none; border: 2px solid #030404; font-size: 12px \"href='"
& $URL
& "'>TestAdd</a>"
This was the code when trying to use Add Record API in the child table (this adds the record, but has a blank still for RID. I am not sure how I saw before it take the parent record ID):
var text RID = "%%rid%%";
var text AddRecord =
URLRoot() & "db/" & [_DBID_SAFETY_ATTENDEES] & "?act=API_AddRecord"
& "&apptoken=xxxxxxxxxxxxxxxxxxx"
& "&_fid_11=" & URLEncode([Record ID#]);
var text EditRecord = URLRoot() & "db/" & [_DBID_SAFETY_ATTENDEES] & "?a=er&rid=" ;
var text URL =
$AddRecord
& "&rdr=" & URLEncode($EditRecord) & $RID;
"<a class='SaveBeforeNavigating' data-replaceRid=true style=\"text-decoration:none; background: #4b7097; border-radius: 5px; color: #ffffff; display: inline-block; padding: 0px 0px 0px 0px; width:100px; text-align: center; text-shadow: none; border: 2px solid #030404; font-size: 12px \"href='"
& $URL
& "'>TestAdd</a>"
------------------------------
Mike Tamoush
------------------------------
Original Message:
Sent: 01-05-2023 18:53
From: Mark Shnier (Your Quickbase Coach)
Subject: API_AddRecord and land the user in edit mode.
Can I see your code?
------------------------------
Mark Shnier (Your Quickbase Coach)
mark.shnier@gmail.com
Original Message:
Sent: 01-05-2023 18:45
From: Mike Tamoush
Subject: API_AddRecord and land the user in edit mode.
The posted code does not work for me. I don't think it is saving the new record before the redirect. Then it tries to redirect and says the record does not exist. I can see that it is putting in a blank for the RID.
I think it would work with NextURL (which defeats the purpose)? I wonder if it would work with API_AddRecord?
------------------------------
Mike Tamoush
Original Message:
Sent: 01-05-2023 16:50
From: Mark Shnier (Your Quickbase Coach)
Subject: API_AddRecord and land the user in edit mode.
This should also work to add a child record and land in edit mode on the child.
------------------------------
Mark Shnier (Your Quickbase Coach)
mark.shnier@gmail.com
Original Message:
Sent: 01-05-2023 16:37
From: Mike Tamoush
Subject: API_AddRecord and land the user in edit mode.
Mark,
Did you ever figure out how to land in edit mode, if the add record is in a different table than the URL button?
& "&disprec=1"; This worked for me to land in view mode, even when adding a child. But I think the solution posted above will only work if you are adding a record to the table you are in, right? Not if you are adding a child?
------------------------------
Mike Tamoush
Original Message:
Sent: 05-03-2022 11:44
From: Mark Shnier (Your Quickbase Coach)
Subject: API_AddRecord and land the user in edit mode.
Just x referencing to a solution.
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
Just posting some code that worked. The goal was to add a record and return the user to the added record in Edit mode.
var text RID = "%%rid%%";
var text AddShipment = URLRoot() & "db/" & Dbid() & "?a=nwr";
var text EditShipment = URLRoot() & "db/" & Dbid() & "?a=er&rid=" ;
var text URL =
$AddShipment
& "&rdr=" & URLEncode($EditShipment) & $RID;
"<a class='SaveBeforeNavigating' data-replaceRid=true style=\"text-decoration:none; background: #4b7097; border-radius: 5px; color: #ffffff; display: inline-block; padding: 0px 0px 0px 0px; width:100px; text-align: center; text-shadow: none; border: 2px solid #030404; font-size: 12px \"href='"
& $URL
& "'>Save and Display in Edit Mode</a>"
NOTE: The %%RID%% does not seem to like being URLEncoded.
The use case might be to land the user on a saved record so that the Report Link fields would immediately populate.
------------------------------
Mark Shnier (YQC)
mark.shnier@gmail.com
Original Message:
Sent: 12-02-2021 17:25
From: Mark Shnier (YQC)
Subject: API_AddRecord and land the user in edit mode.
&disprec=1 is not new.
It's a parameter that basically says when you get done adding the record then display the record equals true. In other words land the user on the record in View mode.
------------------------------
Mark Shnier (YQC)
mark.shnier@gmail.com
Original Message:
Sent: 12-02-2021 17:11
From: Mike Tamoush
Subject: API_AddRecord and land the user in edit mode.
what is the &disprec=1 ? Is that new?
------------------------------
Mike Tamoush
Original Message:
Sent: 11-16-2021 13:04
From: Mark Shnier (YQC)
Subject: API_AddRecord and land the user in edit mode.
This works to works to create a record and land the user in View mode.
URLRoot() & "db/" & [_DBID_SKTDS] & "?act=API_AddRecord"
& "&_fid_6=" & URLEncode([Supplier])
& "&disprec=1";
Is there any way to land the user in edit mode?
------------------------------
Mark Shnier (YQC)
mark.shnier@gmail.com
------------------------------