Forum Discussion
I think you are overcomplicating this. If you just want to land the user on an Add Record form to add a Maintenance record, try this.
var text URLONE = URLRoot() & "db/" & Dbid()& "?act=API_EditRecord&rid=" & [Record ID#] & "&_fid_163=1";
var text URLTWO= URLRoot() & "db/" & [_DBID_MAINTENANCE_REPORT] & "?a=API_GenAddRecordForm&_fid_
$URLONE
& "&rdr="& URLEncode($URLTWO)
------------------------------
Mark Shnier (Your Quickbase Coach)
mark.shnier@gmail.com
------------------------------
- BaileyDesormeau10 months agoQrew Member
So close! I just need to be redirected back to where i started. This is what I did to update yours but it gets stuck on the maintenance table:
var text URLONE = URLRoot() & "db/" & Dbid()& "?act=API_EditRecord&rid=" & [Record ID#] & "&_fid_163=1";
var text URLTWO= URLRoot() & "db/" & [_DBID_MAINTENANCE_REPORT] & "?a=API_GenAddRecordForm&_fid_9=" & URLEncode ([Related Asset]);
var text URLTHREE= URLRoot() & "db/"& [_DBID_MISSION_ASSIGNMENTS] & "?a=dr&key=" &[Related Mission (ref)];
$URLONE
& "&rdr="& URLEncode($URLTWO)
& "&rdr="& URLEncode($URLTHREE)Also, could you help me understand how it figures out the related record id when the table youre starting from is not related to the maintenance report table? The reason i had to overhaul this is because my initial solution used an action from the table thats not related to create a new maintenance report, but I was not able to copy over the record ID to the maintenance table that would make it relate back to the parent table. Does that make sense?
------------------------------
Bailey Desormeaux
------------------------------- MarkShnier__You10 months agoQrew Legend
Try the change in bold. I am assuming that you want to land the user on an add record form which is a child of the asset and then once the user enters details and saves, then you want to redirect back to the asset record.
So, are you using new forms or legacy forms? I do know that there are some buggy issues with new forms and how they able to be redirected upon save.
As for the "Record ID" issue, well I am assuming that the [Related Asset] of the record you are on (perhaps its some kind of inspection record) is the same [Related Asset] of he maintenance record, ie they will both have the same parent asset.
var text URLONE = URLRoot() & "db/" & Dbid()& "?act=API_EditRecord&rid=" & [Record ID#] & "&_fid_163=1";
var text URLTWO= URLRoot() & "db/" & [_DBID_MAINTENANCE_REPORT] & "?a=API_GenAddRecordForm&_fid_9=" & URLEncode ([Related Asset]);
var text URLTHREE= URLRoot() & "db/"& [_DBID_MISSION_ASSIGNMENTS] & "?a=dr&key=" &[Related Mission (ref)];
$URLONE
& "&rdr="& URLEncode($URLTWO)
& "&NextURL="& URLEncode($URLTHREE)
------------------------------
Mark Shnier (Your Quickbase Coach)
mark.shnier@gmail.com
------------------------------- BaileyDesormeau10 months agoQrew Member
Sorry for the confusion, I actually do not want them to edit the record, i simply want the record created. So you click the button, it checks a checkbox, creates a maintenance report and then brings you back to where you started.
------------------------------
Bailey Desormeaux
------------------------------