Forum Discussion
There is more than one way to do this, and the pipeline Ninja Jinja will have fancy methods with loops that count. but they will probably run slowly and be too technical for me, at least.
Here is a fairly low tech solution, which assumes that it is unlikely that two users will be doing this at the exact same time.
- Create a Helper table called Suite Helper with all the possible values for the child records imported into a field called [Counter], so maybe import an excel sheet from 1 to 1,000.
- Create a single record table called Suite Count Select with exactly 1 record in it. It wiull be [Record ID#] = 1 Lock it down so no one, even the admin, can add or delete.
- Create a field on that record called [# of Suites] and another for [Record ID# of Building]. I am making the assumption that the ultimate Parent table for the children will be Parent Table is called Buildings.
- Create a relationship where 1 Suite Count Select has many Suite Helper with a formula reference field on Suite Helpers with a formula of 1. Lookup the [# of Suites] and the [Record ID# of Building].
- Create a saved Table to Table Copy to copy records into the Child table from Suite Helper and map the [Record ID#] (lookup) into [Related Building], and set the filter where the [Counter] is less than or equal to [# of Suites].
- Make a field on Buildings for [# of Suites]
- Now make a Formula URL button on Buildings.
var text SetTargetBuildingAndNumberToCreate =
URLRoot() & "db/" & [_DBID_SUITE_COUNT_SELECT]
& "?act=API_EditRecord&rid="
& "&_fid_6=" & [# of Suites]
& "&_fid_7=" & [Record ID#]; // ie the record ID # of the Building you are sitting on.
var text ImportChildren =
URLRoot() & "db/" & [_DBID_OF_CHILD_TABLE]
& "?act=API_RunImport&ID=10";
var text RefreshPage = URLRoot() & "db/" & Dbid() & "?a=doredirect&z=" & Rurl();
$SetTargetBuildingAndNumberToCreate
& "&rdr=" & URLEncode($ImportChildren)
& URLEncode("&rdr=" & URLEncode($RefreshPage))
Another way to do this with a simpler setup would be to have the same helper table for Suite Helper and trigger a Pipeline with a checkbox on the Buildings table to Search that Table and then get rid of the loop that the Pipeline setup will offer and instead use the relatively new "Import to Quickbase Step"
Either way a Helper table with records from 1 to 1,000 will give you some help.
Feel free to post back with questions or if need be I can hop on a fast call with you next week.