Forum Discussion
KimG
4 years agoQrew Cadet
Hi Mark,
Thanks for the suggestion. I think that would work if my one-to-many relationship was set up in the other direction, that is if Rental Agreement Types had many Buildings. In that case I would only have 3 records in my Rental Agreement Types table, and I could pick the record ID related to "Annual"
However, the relationship I have is: Buildings have many Rental Agreement Types
The data looks more like this:
Building A
The form already knows the related Building, so there should be some way for it to know the related Type of Rental Agreement for the conditions of "Annual" and "Current" - but I'm starting from the Tenant table creating a record on the related Rental Agreement table, so they're more distantly connected.
------------------------------
Kim Gardner
------------------------------
Thanks for the suggestion. I think that would work if my one-to-many relationship was set up in the other direction, that is if Rental Agreement Types had many Buildings. In that case I would only have 3 records in my Rental Agreement Types table, and I could pick the record ID related to "Annual"
However, the relationship I have is: Buildings have many Rental Agreement Types
The data looks more like this:
Building A
- Rental Type "Annual" with conditions XYZ, current - > Record ID 1
- Rental Type "Month to month" with conditions ABC, current - > Record ID 2
- Rental Type "Annual with conditions XY, not current - > Record ID 3
- Rental Type "Annual" with conditions DEF, current - > Record ID 4
- Rental Type "Month to month" with conditions CGY, current -> Record ID 5
The form already knows the related Building, so there should be some way for it to know the related Type of Rental Agreement for the conditions of "Annual" and "Current" - but I'm starting from the Tenant table creating a record on the related Rental Agreement table, so they're more distantly connected.
------------------------------
Kim Gardner
------------------------------
MarkShnier__You
Qrew Legend
4 years agoOK, so 1 Building has many Rental Types and we need for the Building record to know what the Record ID# is for its Current Annual Rental Agreement.
No problem,
Make a Summary of the Maximum Record ID# of the Rental Agreements subject to the filter that it is Current and the Type is Annual. Call that [Record ID# of Current Annual Rental Agreement]. Pass that down to Tenants as that is where your Add Rental Agreement button lives.
URLRoot() & "db/" & [_DBID_RENTAL_AGREEMENTS] & "?a=API_GenAddRecordForm"
& "&_fid_ 9=" & URLEncode ([Record ID#])
& "&_fid_ 38=" & [Record ID# of Current Annual Rental Agreement]
& "&z=" & Rurl()
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------
No problem,
Make a Summary of the Maximum Record ID# of the Rental Agreements subject to the filter that it is Current and the Type is Annual. Call that [Record ID# of Current Annual Rental Agreement]. Pass that down to Tenants as that is where your Add Rental Agreement button lives.
URLRoot() & "db/" & [_DBID_RENTAL_AGREEMENTS] & "?a=API_GenAddRecordForm"
& "&_fid_
& "&_fid_
& "&z=" & Rurl()
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------
- KimG4 years agoQrew CadetThanks Mark! I think I've got it working correctly now. I would not have thought about using the summary field for that. This will be helpful to replicate on other forms I've made. I really appreciate the insight.
------------------------------
Kim Gardner
------------------------------