Forum Discussion

MichaelBralow1's avatar
MichaelBralow1
Qrew Trainee
6 years ago

Adding Hyperlinks to a Formula Text (or Rich Text) Field

I have a field where I am trying to allow for simple IF formula to show either an Individual's Name or an Organization's Names depending on if they have selected a record from the Individuals Table or the Organizations Table. 

If formula is easy 

If([Related Individual]=null,[Organization Name],[Individual - Full Name])

However by doing this the records no longer link to their original record in their specific tables. I would imagine the solution is to make a Rich Text Formula field and some sort of HTML. Anyone have it handy or can problem solve it? It seems like it should be some sort of hyperlink HTML to go with that simple IF formula and it should work but i tried doing an <a href=""> formula and it didn't work for me.

4 Replies

  • When I make Hyperlinks I always make them the same way, no matter how simple or complex.

    var text Words = If(
    [Related Individual]=null,[Organization Name],
    [Individual - Full Name]<>"", [Individual - Full Name]);

    var text URL =
    IF(
    [Related Individual]>0, urlroot() & "db/" & [_DBID_OF_THE_INDIVIDUALS_TABLE] & "?a=dr&rid=" & [Related Individual],

    [Related Organization]>0, urlroot() & "db/" & [_DBID_OF_THE_ORGANIZATION_TABLE] & "?a=dr&rid=" & [Related Organization]);

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

    You will ned to obtain the correct table names from the advanced properties for the table.  It's down near the bottom.
  • This is possible, but I need to understand more.  So the link needs to  to display a parent record, but the parent might be in table A or table B?  Is that what you need?
  • thats exactly right! I figure the easiest way is what I am describing but maybe i'm not thinking outside the box! 
  • this was perfect and a great way of doing this i will remember going forward. Thanks!