Discussions

Expand all | Collapse all

Disable popup that reads ""Save this record?

  • 1.  Disable popup that reads ""Save this record?

    Posted 06-18-2017 06:57
    I understand that overriding the safety measures that QB has put in place is not a good idea but I feel there are always exceptions to the rules.  I have a table in which I have fields that the user inputs information into and with a button click I create the child records, except there is popup that comes up and drives my users mad. These fields are cleared out upon save so I am not concerned about loss of data.  Saving Parent record option does not work as it causes issues with my code.


  • 2.  RE: Disable popup that reads ""Save this record?

    Posted 06-18-2017 09:00
    So are you saying that using to checkbox to automatically save the record when navigating away or adding children manually does not work in your use case?


  • 3.  RE: Disable popup that reads ""Save this record?

    Posted 06-18-2017 14:43
    Have you tried the setting in Advanced Settings on the table to automatically save the parent when adding a child? Not sure if this applies to your workflow without more details though.


  • 4.  RE: Disable popup that reads ""Save this record?

    Posted 06-18-2017 16:23
    I'm not using a checkbox to automatically save the record, I really don't need the record to save I just need the values for that instance.  I have field where the user can input the number of units in a building which tells me how many child records to create, then they use a grid edit report located in the table to complete everything.  I tried using the save parent when adding a child but when the user clicks the button it does an automatic save then calls my code page which will mess up.  Hope this make sense.


  • 5.  RE: Disable popup that reads ""Save this record?

    Posted 06-18-2017 16:31
    Here is what the table looks like.


  • 6.  RE: Disable popup that reads ""Save this record?

    Posted 06-18-2017 22:39
    After doing some searching and rework I was able to get around this issue by implementing Dan Diebolt Save and Scooby Doo Technique.


  • 7.  RE: Disable popup that reads ""Save this record?

    Posted 06-19-2017 11:54
    FWIW, there are a couple of other things you can do:

    (1) Simply noop QuickBase's ConfirmLinkAway function by redefining it with no body: 

    function ConfirmLinkAway(){} 
    (2) Define a Mutation Observer so that when the dialog appears your code immediately clicks on the Save button. 

    $(function(){
      var observer = new MutationObserver(function(mutations) {
        
        mutations.forEach(function(mutation) {
          if (mutation.type == "childList" && mutation.target.getAttribute("id") == "dialogLinkAway") {
            $("#dialogLinkAway button:contains(Save)").click();
          }
        });
      });
      var body = document.body;
      
      var config = {
        childList: true,
        subtree: true
      };
      observer.observe(body, config);
    });

    I didn't test this code but it should work. See this example of a Mutation Observer that focused on the Save button when a certain Form Rule Dialog Box appeared:

    Form Rule Message Box - Dismiss With Enter Rather Than Click
    https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=274


  • 8.  RE: Disable popup that reads ""Save this record?

    Posted 06-25-2017 04:43
    Thanks for the response Dan, I haven't tried this out yet but I will.  Your Save and Scooby Doo Technique is awesome and actually worked out better for this situation.


  • 9.  RE: Disable popup that reads ""Save this record?

    Posted 08-16-2018 14:25
    New to this and seeing something similar, I want a form to hold temp values until we have an invoice that is suitable, when I update fields we get a message box asking to save so all values are lost.
    Where should the code "function ConfirmLinkAway(){}" be stored?  In the table, form, code page and how should it be called?


  • 10.  RE: Disable popup that reads ""Save this record?

    Posted 08-19-2018 18:13
    Script is saved in code pages and accessed from you QuickBase pages using a script injection technique such as IOL. You can read about the IOL technique here:

    https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=294

    By placing this code 
    function ConfirmLinkAway(){}
    in you script you are redefining QuickBase's authored function named ConfirmLinkAway to do nothing. It is a little know fact that you can redefine any function even those authored by QuickBase. In general redefining functions is not a good idea but we are in the world of workarounds here. This situation reminds me of this play:

    She Stoops to Conquer


    Beyond that ask a new question concerning your specific need and context.