Discussions

 View Only
  • 1.  How do I create a Formula-URL in a parent table to link to an attachment in specific child record?

    Posted 01-23-2019 13:54
    I would like to create a field in a parent table that displays a hyperlink to a file attachment in the most recent child record.  I have already created a summary field that finds the Record ID# of the target child record.  Knowing the child record ID and the field ID that holds the file attachment, how do I write the equation for the hyperlink?


  • 2.  RE: How do I create a Formula-URL in a parent table to link to an attachment in specific child record?

    Posted 01-23-2019 14:01
    The URL formula would be this

    URLRoot() & "up/" & [_DBID_DOCUMENTS] & "/a/r" & [Focus Document Record ID#] & "/e11/v0"


    the e11 means that the file attachment is in field ID11.
    The [_DBID_DOCUMENTS] needs to be the table name from advanced properties where the file attachment is stored.

    If you wanted a hyperlink to allow display the file name, then that is another question and a bit fancier answer, but regardless, get this working first.



  • 3.  RE: How do I create a Formula-URL in a parent table to link to an attachment in specific child record?

    Posted 01-23-2019 15:51
    Thanks! I got it to work with this formula:

    URLRoot() & "up/" & [_DBID_ZWZ_Dwg_Revisions] & "/a/r" & [Maximum Record ID#] & "/e13/v0"

    You also accurately anticipated my next need: having the link display as the name of the file attachment rather than the actual link.  How do I do this?

    Also, if the target field has no attachment, I'd like the result of the formula to be blank.


  • 4.  RE: How do I create a Formula-URL in a parent table to link to an attachment in specific child record?

    Posted 01-23-2019 16:00
    :) OK  hyperlink.

    So a hyperlink basically consists of the URL to go to, which you have  mastered, plus some words to click on.  So we need the words.  We can make use of the recent December 2018 feature to summarize text up to a parent.

    Make a formula text field on the child record  as ToText([my file attachment field])

    You have the [Maximum Record ID#] field up on the Parent.  Look that up down to the children.

    Make a Summary Combined text field on the relationship to summarize the file name words, subject to the filter that the [Record ID#] =  [Maximum Record ID#]

    (ie there will only be 1 lucky qualifying record to Summarize) 

    Finally make the Hyperlink field as a formula Rich Text field.

    var text URL = [insert the URL field that you previous got working];
    var text Words = ToText([My Summary Combined text field]); 

    "<a href=" & $URL & ">" & $Words & "</a>







  • 5.  RE: How do I create a Formula-URL in a parent table to link to an attachment in specific child record?

    Posted 01-23-2019 18:18
    Great! This worked and did everything that I was looking for.  Thank you.