Forum Discussion

Re: Utilizing a different form when clicking the "Add Record" button

Oh, that might be the problem, I am using a URL Formula type field, not a Rich Text Formula field. The formula I pasted above is exactly what I have in there now.

------------------------------
Chris Swirtz
------------------------------

6 Replies

  • ChrisSwirtz2's avatar
    ChrisSwirtz2
    Qrew Cadet
    I just tried the same formula in a Rich Text Formula field and it's giving me the same error

    var text URLGenAdd=URLRoot() & "db/" & [_DBID_PERIPHERALS] & "?a=API_GenAddRecordForm&_fid_15" & URLEncode ([Record ID#])&"&dfid=11" & "&z=" & Rurl();

    ------------------------------
    Chris Swirtz
    ------------------------------
  • DonLarson's avatar
    DonLarson
    Qrew Commander

    Chris,

    That is it.  Change the field type.


    // Images
    var text IMGLock  =     "<img src=https://images.quickbase.com/si/48/045-lock.png>"

    // URL
    var text URLGenAdd=
    URLRoot() & "db/" & [_DBID_PERIPHERALS] &
    "?a=API_GenAddRecordForm&_fid_15=" & URLEncode ([Record ID#]) &
    "&dfid=11" & "&z=" & Rurl();

    // UI
     "<a href=" & $URLGenAdd & "' title=\"Click Me\">"  & $IMGLock &  "</a>"


    ------------------------------
    Don Larson
    Paasporter
    Westlake OH
    ------------------------------
    • DonLarson's avatar
      DonLarson
      Qrew Commander
      Chris,

      By the way, change the image at the top to something that makes sense for your user base.  I use that lock as default for status changes to records.   It is probably nonsensical for your business case.

      ------------------------------
      Don Larson
      Paasporter
      Westlake OH
      ------------------------------
    • ChrisSwirtz2's avatar
      ChrisSwirtz2
      Qrew Cadet
      Well Don, that worked, thank you. Couple things though...

      1. Is there way to show a button instead of that lock picture?
      2. this type of field does not have the option to open in a new window like others do (unless you right click and select that from the menu, which they won't want to do). This is something my boss is definitely going to ask for.

      ------------------------------
      Chris Swirtz
      ------------------------------
      • Quick_BaseJunki's avatar
        Quick_BaseJunki
        Qrew Captain
        Hi Chris,

        I came across this thread in the Quick Base Newsletter and thought I'd chime in.

        You can still use the Formula URL field as you desired (shown as a button and open in a new window). Just drop the variable portion of the formula you're using such as this...
        URLRoot() & "db/" & [_DBID_PERIPHERALS] &
        "?a=API_GenAddRecordForm&_fid_15" &
        URLEncode ([Record ID#])&"&dfid=11" & "&z=" & Rurl()ā€‹


        There are also ways to format the rich text formula to open in a new window and show as a button, but it's likely not worth the extra coding if you just simplify the formula and use the Formula URL button.

        Let me know if this helps šŸ˜ŠšŸ‘



        ------------------------------
        Sharon Faust (QuickBaseJunkie.com)
        Founder, Quick Base Junkie
        https://quickbasejunkie.com
        ------------------------------