Forum Discussion
MikeTamoush
3 years agoQrew Elite
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
------------------------------
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
------------------------------
MarkShnier__You
Qrew Legend
3 years agoThis 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
------------------------------
------------------------------
Mark Shnier (Your Quickbase Coach)
mark.shnier@gmail.com
------------------------------
- MikeTamoush3 years agoQrew EliteThe 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
------------------------------- MarkShnier__You3 years ago
Qrew Legend
Can I see your code?
------------------------------
Mark Shnier (Your Quickbase Coach)
mark.shnier@gmail.com
------------------------------- MikeTamoush3 years agoQrew EliteThis 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
------------------------------
- MikeTamoush3 years agoQrew EliteUpdate:
Functionality worked with AddRecordAPI, unfortunately it turns out when launching from the parent, the %%rid%% references the Parent Record ID, rather than the newly created Record ID.
------------------------------
Mike Tamoush
------------------------------- MarkShnier__You3 years ago
Qrew Legend
did you try this?
var text URL =
$AddRecord
& "&NextURL=" & URLEncode($EditRecord) & $RID;
------------------------------
Mark Shnier (Your Quickbase Coach)
mark.shnier@gmail.com
------------------------------- MikeTamoush3 years agoQrew EliteYes. Interestingly, still no luck. I am wondering if I need GenRecordAdd form. But either way, if I use NextURL it defeats the purpose, because the goal is the user doesnt stop on add record. The goal is the record is quickly added in the background, and then the user lands in edit mode on the record. To the user, they are adding a record, they just dont realize the Record ID now already exists.
------------------------------
Mike Tamoush
------------------------------