Forum Discussion

ScottHunter's avatar
ScottHunter
Qrew Member
3 years ago

Adding Documents to tables with related ID

Hello, I am trying to figure out how/why my QB is doing this.
I have 3 tables I am trying to work with.  The main table is "Jobs", 2nd Table is Documents, 3rd is "Permits".  The issue I am having is when I add a document via the Jobs table it links automatically (see attachment called linked id), however when I try and add a document via the permits table it does not automatically link... (See attachment ID not linked).  When I look at all the field settings I can't find the issue.

------------------------------
Scott Hunter
------------------------------

1 Reply

  • Hi Scott:

    Let's say your Related Permit field id is X in Documents table so your Add Document button formula in Permits table looks like below:
    URLRoot() & "db/" & [_DBID_DOCUMENTS] & "?a=API_GenAddRecordForm&_fid_X=" & URLEncode ([Record ID#])& "&z=" & Rurl()

    Also let's say your Related Job field id is Y in Documents Table. Related Job(below) field is in Permits table. So you need to modify your Add Document formula to below:

    URLRoot() & "db/" & [_DBID_DOCUMENTS] & "?a=API_GenAddRecordForm&_fid_Y=" & URLEncode ([Related Job])&_fid_X=" & URLEncode ([Record ID#])& "&z=" & Rurl()

    Hope this helps
    Thank You

    ------------------------------
    Razi D.
    Desta Tech LLC
    razi@destatechs.com
    ------------------------------