Forum Discussion
Are your light tower table and inspection reports table related? For example - do light towers have many inspection reports? If yes - then you can simply add the [Related Light Tower] field in your Add Record Button as an additional parameter so it auto fills as you expect.
No matter what - in order for the light tower to populate from an inspection report - you have to know which light tower it should be when you're coming from the inspection report.
------------------------------
Chayce Duncan
------------------------------
- BaileyDesormeau2 years agoQrew MemberAre your light tower table and inspection reports table related?Chayce Duncan, 01-11-2024 15:52
Yes they are
If yes - then you can simply add the [Related Light Tower] field in your Add Record Button as an additional parameter so it auto fills as you expect.Chayce Duncan, 01-11-2024 15:52Can you please show me an example of this? Thanks so much!
------------------------------
Bailey Desormeaux
------------------------------- ChayceDuncan2 years agoQrew Captain
On your inspection report - go into the settings for the add button that you're clicking.
The format should be something like:
URLRoot() & "db/" & [_DBID_ATTACHMENTS] & "?a=API_GenAddRecordForm" &
"&_fid_A=" & [Record ID#]In this case - fid_A should have a # instead of A. That fid is the 'related inspection report' on the attachment. So you need to add another similar to that to pass in your related light tower like:
URLRoot() & "db/" & [_DBID_ATTACHMENTS] & "?a=API_GenAddRecordForm" &
"&_fid_A=" & [Record ID#] &
"&_fid_B=" & [Related Light Tower]Where you need swap the value of B with the field ID of the related light tower field in the Attachments table.
------------------------------
Chayce Duncan
------------------------------- BaileyDesormeau2 years agoQrew Member
This all makes total sense, however. I did not change anything (using default add attachment button) from the inspection report table, and now it doesnt fill in the related inspection report when I am adding an attachment from an already created inspection report. Here is the add attachment button formula:
URLRoot() & "db/" & [_DBID_LIGHT_TOWER_ATTACHMENTS] & "?a=API_GenAddRecordForm&_fid_60=" & URLEncode ([Record ID#])& "z=" & Rurl()
Field 60 is the related "service" report, we renamed this table, sorry a bit confusing. But when i use this button, field 60 has nothing in it and the proxy field shows nothing.
------------------------------
Bailey Desormeaux
------------------------------