Forum Discussion

EricEvans_Varga's avatar
EricEvans_Varga
Qrew Cadet
7 years ago

Is there a way to consolidate multiple URL buttons into one button, but use the link text/color of each individual button

I currently have 4 different buttons that do 4 different things (and am about to add more).
To avoid having users click the wrong button inadvertently, they only show on certain records depending on the record type.

Since I'm about to add more buttons, I'd like to see if there is a way to consolidate all of these buttons into one.

I need the button to show the action (label of the original button)

I thought if I added an IF statement to a Rich Text field that displayed the appropriate button that would solve my issue, but it only displays the text of the button, not the button itself.

Three of the different buttons:


What the Rich Text formula returns (apologies for the redaction):


The formula is working, by pasting the correct button ... it just pastes the formula behind the button and not the button itself.

I figured if I do this on a URL field, it will work ... but I will then only be able to display the text of that field, and not the individual fields that are being referenced.

Below is an example of it working, but only with the text of that assigned button:
  • The format for a Rich text field is

    var text Words = "My words including any HTML";
    var text URL = a formula for the URL with a IF;

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

    • EricEvans_Varga's avatar
      EricEvans_Varga
      Qrew Cadet
      I'm afraid I don't follow ... have I mentioned I'm terrified of java ...
      I've tried plugging in the formulas but don't quite think I know what I've done.
    • QuickBaseCoachD's avatar
      QuickBaseCoachD
      Qrew Captain
      I would have to see your attempt in order to edit it.  Paste it in the forum, but the forum tends to garble postings with hyperlinks, so you you may need to post it in and then highlight it and use the PRE button below the box.
    • EricEvans_Varga's avatar
      EricEvans_Varga
      Qrew Cadet
      Here's what I've done so far ... trying to add on two of the buttons first:

      If([Leave Type]="Transitional Duty" and [Leave Report Date]=Today(),
      var text Words = "OT on Trans Duty";
      var text url= 
      "<a href=" & $URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" &
          "&rid=" & [Record ID#] &
      "&apptoken=####"&
              "&_fid_70=True" &
              "&_fid_67=OT on Transitional Duty" &
              "&_fid_58="& URLEncode(User()); & ">" & $Words & "/>"
      [Leave Description]="Continuous" and [Leave Report Date]=Today(),
      var text Words = "RTW"
      var text url= 
      "<a href=" &$URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" &
          "&rid=" & [Record ID#] &
      "&apptoken=####"&
              "&_fid_63=True" &
              "&_fid_67=Return to Work" &
              "&_fid_58="& URLEncode(User());
         
      "javascript:" & "$.get('" & $url & "', function(){" & "location.reload();" &
          "});" & "void(0);"
      ,"")