Forum Discussion
XavierFan
12 years agoQrew Cadet
I've created an example app in Exchange - called "Example - Lookup File Attachment through Many-to-Many Relationship". You can find it here:
https://www.quickbase.com/db/main?a=AppDetail&ID=1439&app_name=Example%20-%20Lookup%20File
There are 3 tables:
- Procedures - with a File Attachment field
- Issues
- Resolutions - the intermediate table in the many-to-many relationship between Procedures and Issues.
The basic set up for a Many-to-Many relationship is detailed here:
http://www.quickbase.com/user-assistance/Default.html#many_to_many_relationship.html
You cannot lookup a File Attachment field directly.
To enable a lookup to the File Attachment field (in the Procedures table) - create a Formula Text field (called "File Attachment Link" here, with HTML tags enabled) with this formula:
If ([File Attachment] = "", "",
"<a href='" & URLRoot() & "up/" & Dbid() & "/a/r" & [Record ID#] & "/e7/v0' target='_blank' >" & [File Attachment] & "</a>")
Note the "e7" portion of the formula. The "7" refers to the Field ID of the File Attachment field. Modify accordingly for your own app.
This "File Attachment Link" link field can now be looked up in the Resolution table, and also on the Issues table.
In the example app - see that Procedure A is the Resolution for Issues 1 and 2 - with the same Document A accessible from both. Procedure B is the Resolution for Issue 3. Issue 4 is resolved by both Procedure A and Procedure B.
The only real additional step in setting the relationship (on top of a normal many-to-many relationship) - is setting the File Attachment Link field. Once you have that - you can look it up normally.
So once you're in the Issue, you press "Add Resolution", and select the Procedure. Then on the Issue, you can now see the File Attachment Link for that Procedure, which you can click directly to download the document.
Hope this helps!
https://www.quickbase.com/db/main?a=AppDetail&ID=1439&app_name=Example%20-%20Lookup%20File
There are 3 tables:
- Procedures - with a File Attachment field
- Issues
- Resolutions - the intermediate table in the many-to-many relationship between Procedures and Issues.
The basic set up for a Many-to-Many relationship is detailed here:
http://www.quickbase.com/user-assistance/Default.html#many_to_many_relationship.html
You cannot lookup a File Attachment field directly.
To enable a lookup to the File Attachment field (in the Procedures table) - create a Formula Text field (called "File Attachment Link" here, with HTML tags enabled) with this formula:
If ([File Attachment] = "", "",
"<a href='" & URLRoot() & "up/" & Dbid() & "/a/r" & [Record ID#] & "/e7/v0' target='_blank' >" & [File Attachment] & "</a>")
Note the "e7" portion of the formula. The "7" refers to the Field ID of the File Attachment field. Modify accordingly for your own app.
This "File Attachment Link" link field can now be looked up in the Resolution table, and also on the Issues table.
In the example app - see that Procedure A is the Resolution for Issues 1 and 2 - with the same Document A accessible from both. Procedure B is the Resolution for Issue 3. Issue 4 is resolved by both Procedure A and Procedure B.
The only real additional step in setting the relationship (on top of a normal many-to-many relationship) - is setting the File Attachment Link field. Once you have that - you can look it up normally.
So once you're in the Issue, you press "Add Resolution", and select the Procedure. Then on the Issue, you can now see the File Attachment Link for that Procedure, which you can click directly to download the document.
Hope this helps!