Forum Discussion

ChyanneEyde's avatar
ChyanneEyde
Qrew Trainee
5 years ago

Rich text field button with "unsupported content"

 Hello! I have a Rich text field called "Go to Next Tab" that is a button on a form. When clicked, it saves the record and leads the user to a second tab. It's been working perfectly for my use for months, and still works, but a message now appears, "This field includes unsupported content. We support the Quickbase formula syntax, as well as limited HTML. You can use JavaScript on code pages only." It goes on to say that "formulas with unsupported content may cease working without notice." 

In an effort to avoid my very useful field from ceasing to work without notice, I am trying to get it into a form that is permissible. I could use some advice. I do have JS in a code page and the HTML tag I use, an a tag, appears to be in the list of HTML tags available for text fields. I tried so reconfigure a bit, but still get the message. Can anyone point out where I am breaking with QB guidance? I am sure I am overlooking something and would love another set of eyes on it. My field's formula is below. (For additional context, I originally created the field with inspiration from this QB community post. )

In the formula, I reference two variables and two code pages: 

[customButtonScript1]
    &"SaveAndNextTab.js"
    &[customButtonScript2]
    &"SaveandNextTabStyle.html"

Below is the content of each variable and code page: 

customButtonScript1: <a href='javascript:($.getScript("https://octo.quickbase.com/db/bg8rdt9ai?a=dbpage&pagename=
SaveAndNextTab,js:
var nextTabLink=$("li.ui-tabs-active").next("[style!='display:none']").children("a");
$("#saveAndKeepWorkingMenuOption").click();
var noErrorDialog=$('#qbDialog').length==0;
if( noErrorDialog ){
$(nextTabLink).click();
location.assign('#navTop');
};
customButtonScript2: "));void(0);
SaveandNextTabStyle.html: 'class='Vibrant' style='background:#3399CC; border-radius: 5px; padding:8px 16px; text-decoration:none; color:#ffffff; display:inline-block; font-size:14px; text-align:center; white-space:nowrap'>Next</a>

When clicked, the button produces ($.getScript("https://octo.quickbase.com/db/bg8rdt9ai?a=dbpage&pagename=SaveAndNextTab.js"));void(0);


------------------------------
Chyanne
------------------------------
  • I have two comments. The first is that your existing button is not going to fail in the future. QuickBase plans to phase out on a going forward basis the use of JavaScript and URL formula buttons  and Rich text fields.  

     But they will not break existing functionality. They're just will come a day where you won't be able to edit the contents of that field anymore. 

     I can't help you with the JavaScript but I believe that it is the word JavaScript that triggers the message.    It is possible that you can find some tips in Kirk Trachy's magic buttons app.  He appears to call code pages without using the word JavaScript.

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------
    • ChyanneEyde's avatar
      ChyanneEyde
      Qrew Trainee
      Thanks for your comment, Mark. I will say that I actually have another field using Javascript to show a button that was operating and then stopped yesterday, which is the reason I am concerned about the topic of my post. So, I do feel like my existing functionality was broken! 

      I'll take a look at the magic buttons app, thanks again!

      ------------------------------
      Chyanne Eyde
      ------------------------------
  • AustinK's avatar
    AustinK
    Qrew Commander
    The way Quickbase seems to want you to do this is to only have the button open up the code page and then to do every bit of JavaScript on the code page itself. So instead of using jQuery to grab the code page you would instead just use the code pages URL to load it and go from there. If you need a RID to be used by the code page you can send that in the URL of the page itself. Kind of like this but probably not calling a JavaScript page and more like HTML with JavaScript.

    https://<realm>.quickbase.com/db/bg8rdt9ai?a=dbpage&pagename=SaveAndNextTab.js&myRID=[Record ID#]

    Then you would pluck that RID out of the URL with JavaScript itself and continue doing whatever calls you needed to do.

    I'm not sure if that could ever work for what I believe your workflow here is but I think it would. You would just need to redesign it a bit. Here is a link to a recent blog post that contains a link to a sample app for code pages they released recently. This might help guide you on what to do next.

    https://community.quickbase.com/blogs/graham-leto2/2021/03/02/code-page-samples?CommunityKey=d860b0f8-6a48-487b-b346-44c47a19a804-------------------------------------------
    Original Message:
    Sent: 03-10-2021 08:04
    From: Chyanne Eyde
    Subject: Rich text field button with "unsupported content"

     Hello! I have a Rich text field called "Go to Next Tab" that is a button on a form. When clicked, it saves the record and leads the user to a second tab. It's been working perfectly for my use for months, and still works, but a message now appears, "This field includes unsupported content. We support the Quickbase formula syntax, as well as limited HTML. You can use JavaScript on code pages only." It goes on to say that "formulas with unsupported content may cease working without notice." 

    In an effort to avoid my very useful field from ceasing to work without notice, I am trying to get it into a form that is permissible. I could use some advice. I do have JS in a code page and the HTML tag I use, an a tag, appears to be in the list of HTML tags available for text fields. I tried so reconfigure a bit, but still get the message. Can anyone point out where I am breaking with QB guidance? I am sure I am overlooking something and would love another set of eyes on it. My field's formula is below. (For additional context, I originally created the field with inspiration from this QB community post. )

    In the formula, I reference two variables and two code pages: 

    [customButtonScript1]
        &"SaveAndNextTab.js"
        &[customButtonScript2]
        &"SaveandNextTabStyle.html"

    Below is the content of each variable and code page: 

    customButtonScript1: <a href='javascript:($.getScript("https://octo.quickbase.com/db/bg8rdt9ai?a=dbpage&pagename=
    SaveAndNextTab,js:
    var nextTabLink=$("li.ui-tabs-active").next("[style!='display:none']").children("a");
    $("#saveAndKeepWorkingMenuOption").click();
    var noErrorDialog=$('#qbDialog').length==0;
    if( noErrorDialog ){
    $(nextTabLink).click();
    location.assign('#navTop');
    };
    customButtonScript2: "));void(0);
    SaveandNextTabStyle.html: 'class='Vibrant' style='background:#3399CC; border-radius: 5px; padding:8px 16px; text-decoration:none; color:#ffffff; display:inline-block; font-size:14px; text-align:center; white-space:nowrap'>Next</a>

    When clicked, the button produces ($.getScript("https://octo.quickbase.com/db/bg8rdt9ai?a=dbpage&pagename=SaveAndNextTab.js"));void(0);


    ------------------------------
    Chyanne
    ------------------------------