Discussions

Expand all | Collapse all

[object Object] Error in Internet Explorer 11

  • 1.  [object Object] Error in Internet Explorer 11

    Posted 13 days ago
    Edited by Peter Rebholz 13 days ago

    Hello,

    I have created a Formula Rich Text button that checks a box and reloads the page. The function works flawlessly in Chrome and Edge, but when using Internet Explorer 11 I get a blank page with "[object Object]". If I navigate away from this page I can see that the API call has gone through and the box is indeed checked. 

    After digging around on the internet I thought it was the "location.reload();" javascript function. However, I dug into the Magic Buttons app, and the buttons that use "location.reload();" in there and they seem to work fine refreshing the page in IE 11.

    Does anyone know of any other issues that could cause this, or alternate methods of accomplishing this task which would me more robust across different browsers?

    Thank you!

    var text target = "'blank'";
    var text class = "'Vibrant Danger'";
    var text style = "'width:100px; text-align: center;'";
    var text URL = URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&key=" & [SCHEDULE NUMBER] & "&_fid_465=1"; 

    If(
    [HAS MDL]=false,
    "<a " &
    " class=" & $class &
    " style=" & $style &
    "href=" & "javascript:$.get('" & $URL & "',function(){location.reload();}); void(0);>Create MDL</a>"

    )



    ------------------------------
    Peter Rebholz
    ------------------------------


  • 2.  RE: [object Object] Error in Internet Explorer 11

    Posted 13 days ago
    Have you tried location.reload(true)? That is the only solution I am finding. I don't have internet explorer installed to test with though.




  • 3.  RE: [object Object] Error in Internet Explorer 11

    Posted 13 days ago
    Edited by Peter Rebholz 13 days ago

    Hi Austin,

    Yes my apologies I forgot to include the other attempted syntaxes.

    I have tried:

    location.reload();
    location.reload(true);
    window.location.reload();
    window.location.reload(true);
    histroy.go(0);

    All of which give the [object Object] error


    I have also tried:
    window.location=window.location
    window.location.href=window.location.href

    Both of these execute the API call, but seem to freeze the page without refreshing it. 

    *Edit* had the order of "location" and "window" accidentally reversed 
    ------------------------------
    Peter Rebholz
    ------------------------------



  • 4.  RE: [object Object] Error in Internet Explorer 11

    Posted 13 days ago
    If the button is only doing these two functions - checking a field and then reloading the page, you can build the button without the JS. Here is how I would suggest:

    var text chk = "&_FID_34="; var text tk = "token"; "<a class='Vibrant Alert' & href=" & URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&apptoken=" & $tk & "&rid=" & [Record ID#] & $chk & "1" & "&rdr=" & URLEncode(URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & [Record ID#]) & ">Check and Refresh</a>"​
    Just update the FID and the Token in the Var's and you should be good to go.

    ------------------------------
    Blake Harrison
    bharrison@datablender.io
    DataBlender - Quick Base Solution Provider
    Atlanta GA
    404.800.1702 / http://datablender.io/
    ------------------------------



  • 5.  RE: [object Object] Error in Internet Explorer 11

    Posted 13 days ago
    Hi Peter - as Blake mentioned, doing this natively is the best method. We technically do not support JavaScript in formulas. Also, IE11 has a lot of interesting oddities that might cause things like this. Do you mind if I ask if there is a reason your users aren't on a more modern browser?

    ------------------------------
    Harrison Hersch
    ------------------------------



  • 6.  RE: [object Object] Error in Internet Explorer 11

    Posted 13 days ago

    Hi Harrison,

    Yes I try to avoid JS as much as possible since it could become obsolete within Quick Base, but since there are several reports which the button appears I could not find a native way to redirect back to the page the button was clicked on. 

    There are a few tasks that require the use of IE, infuriating as that may be, but they are not the majority of daily tasks as far as I know.  I would much prefer that they switch to a more modern browser for everyday use and use IE only when necessary. If a solution cannot be found I'm sure (barring any reason I may be unaware of)  we could mandate a switch. 



    ------------------------------
    Peter Rebholz
    ------------------------------



  • 7.  RE: [object Object] Error in Internet Explorer 11

    Posted 13 days ago

    Hi Blake,

    Thank you for the response! While this does work, it always redirects back to the form.

    This button appear on several reports and I was hoping that the user could click on the button, and then have the page refreshed so that they can see the other options that appear on that report as a result.



    ------------------------------
    Peter Rebholz
    ------------------------------



  • 8.  RE: [object Object] Error in Internet Explorer 11

    Posted 13 days ago
    The best way to handle this today in a supportable fashion is making multiple buttons. However, we will add some capabilities to formula-url buttons to better handle a redirect.

    ------------------------------
    Harrison Hersch
    ------------------------------



  • 9.  RE: [object Object] Error in Internet Explorer 11

    Posted 13 days ago

    Ah, I was afraid that might be the case.

    Then I think for the moment I the best option is to investigate the browsers that the users are working in and see if we can get them to switch over. 

    Thank you everyone for all your help!



    ------------------------------
    Peter Rebholz
    ------------------------------



  • 10.  RE: [object Object] Error in Internet Explorer 11

    Posted 13 days ago
    Peter -

    I agree with Harrison and have had this exact use case within a client's app. In these instances, I build individual buttons for each use case, slightly modifying the RDR for each one. If you're going to redirect to a report, it would just be a matter of changing the report ID for each button.

    var text chk = "&_FID_34=";
    var text tk = "token";
    var number qid = #;

    "<a class='Vibrant Alert' & href=" & URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&apptoken=" & $tk & "&rid=" & [Record ID#] & $chk & "1" & "&rdr=" & URLEncode(URLRoot() & "db/" & Dbid() & "?a=q&qid=" & $qid) & ">Check and Refresh</a>"



    ------------------------------
    Blake Harrison
    bharrison@datablender.io
    DataBlender - Quick Base Solution Provider
    Atlanta GA
    404.800.1702 / http://datablender.io/
    ------------------------------



  • 11.  RE: [object Object] Error in Internet Explorer 11

    Posted 13 days ago

    Turns out that it's happening in Firefox too, which is odd. 

    I may well have to go the  multiple buttons route then. Thanks for the sample code, Blake. Just varying the report number as a variable should help reduce the messiness of multiple buttons.

    Thanks! 



    ------------------------------
    Peter Rebholz
    ------------------------------