Discussions

Expand all | Collapse all

Is it possible to create a ""Save and Keep Working"" button from a formula URL field?

none none02-06-2018 13:57

Chad Brandmire01-29-2018 17:15

QB Development01-29-2018 19:41

  • 1.  Is it possible to create a ""Save and Keep Working"" button from a formula URL field?

    Posted 11-21-2017 14:07
    I realize the "Save and Keep Working" button was introduced by Quickbase, but I am wanting to add it somewhere in the middle of my form. I've seen posts relating to this kind of thing, but all of theme were published prior to the introduction of the "Save and Keep Working Button" and I can't seem to get any of them to work. Any thoughts?


  • 2.  RE: Is it possible to create a ""Save and Keep Working"" button from a formula URL field?

    Posted 12-26-2017 20:09
    Try this in a Formula Rich Text

    var text urlone = URLRoot() & "db/" & [_DBID_TABLE_1] & "?a=dr&dfid=2&rid=" & URLEncode([Route ID#]);

    "<a href="& $urlone &"><img width=\"100\"src=\"<i><u>Link your button image here</u></i>\"></a>";


  • 3.  RE: Is it possible to create a ""Save and Keep Working"" button from a formula URL field?

    Posted 12-28-2017 18:31
    Hi Chad,

    Thanks for your response. I just tried this and perhaps I'm doing something wrong, but this is saving the record, but then opening the form in view mode; as opposed to saving and reopening edit mode. Any thoughts?


  • 4.  RE: Is it possible to create a ""Save and Keep Working"" button from a formula URL field?

    Posted 12-28-2017 18:33
    Try changing

    a=dr

    to

    a=er


  • 5.  RE: Is it possible to create a ""Save and Keep Working"" button from a formula URL field?

    Posted 12-28-2017 18:38
    I tried this as well, but now I'm noticing that regardless of whether it is dr or er, it doesn't save any of the data entered into the form prior to pressing the button. All it is doing is reopening the form in either view or edit mode, as opposed to saving and reopening the edit form.

    My code is as follows:

    var text urlone = URLRoot() & "db/" & [_DBID_GAMES] & "?a=er&dfid=2&rid=" & URLEncode([Record ID#]);

    "<a href="& $urlone &"><img width=\"100\"src=\"<i><u>https://cdn.maxbuttons.com/wp-content/themes/maxbuttons-theme/images/icons/basic-buttons-pack.png<...">https://cdn.maxbuttons.com/wp-content/themes/maxbuttons-theme/images/icons/basic-buttons-pack.png</u></i>\"></a>"">https://cdn.maxbuttons.com/wp-content/themes/maxbuttons-theme/images/icons/basic-buttons-pack.png<...;


  • 6.  RE: Is it possible to create a ""Save and Keep Working"" button from a formula URL field?

    Posted 12-28-2017 18:40
    I do not have a solution for you.


  • 7.  RE: Is it possible to create a ""Save and Keep Working"" button from a formula URL field?

    Posted 12-28-2017 18:43
    Alright, thank you anyway. I appreciate it.


  • 8.  RE: Is it possible to create a ""Save and Keep Working"" button from a formula URL field?

    Posted 12-28-2017 21:39
    Put a Rich Text Formula field in the middle of your form with this definition:

    "<div style='Vibrant Success' onclick=$('#footerSaveAndKeepWorkingMenuOption').click();>Save and Keep Working</div>"

    When it is clicked it will trigger the clicking of the native Save and Keep Working button (even though it is not visible at the moment).  FWIW, this type of strategy of embedding JavaScript into a form which emulates a user clicking on a native features is safer than other methods of more directly invading the native markup and code.


  • 9.  RE: Is it possible to create a ""Save and Keep Working"" button from a formula URL field?

    Posted 12-28-2017 22:15
    Thank you so much, this is exactly what I was looking for! HUGE help.


  • 10.  RE: Is it possible to create a ""Save and Keep Working"" button from a formula URL field?

    Posted 12-28-2017 22:27

    _________________ < You are welcome > ----------------- \ /\/\ \ \/\/ \ / -\ \ / oo -\ \ / \ | ---\ -\ \--/ \ \ | -\ \ -\ -------------\ /-\ \ \-------/ ---/ \ \ |\ \ | / | | \ | \ | | / \ | | / \ | \ \ \| - /--------\ | o \+ +--------- \ | | | | \ | | \ | | | | \ | | \ | \ | | | | | \ \ | | | | +--+ ---+


  • 11.  RE: Is it possible to create a ""Save and Keep Working"" button from a formula URL field?

    Posted 12-29-2017 05:41
    Hat's Off Dan! You will always be a Champ of this Community. :)

    Thanks,
    Gaurav


  • 12.  RE: Is it possible to create a ""Save and Keep Working"" button from a formula URL field?

    Posted 01-18-2018 15:41
    Is there a way to make that call the header button instead of the footer?


  • 13.  RE: Is it possible to create a ""Save and Keep Working"" button from a formula URL field?

    Posted 01-18-2018 15:54
    Nevermind. figured out what I needed to do.

    "<div style='Vibrant Success' onclick=$('#saveButton').click();><img width='100' src='_Image link Here'></div>"">https://cokem.quickbase.com/up/bnckjw5jp/g/rg/eg/va/save-button.png'></div>"">'></div>";


  • 14.  RE: Is it possible to create a ""Save and Keep Working"" button from a formula URL field?

    Posted 02-06-2018 12:54
    Not sure what the difference might be...but this worked beautifully in one of my applications right out of the box....but can't get it to work in another app?  I have looked at all the security setups and I can't see a difference between the apps?  What am I missing?  


  • 15.  RE: Is it possible to create a ""Save and Keep Working"" button from a formula URL field?

    Posted 02-06-2018 13:18
    You are not providing any significant information to debug this other than saying one case works and the other doesn't.

    Can you copy each application and produce the same two different results? If so there is probably some subtle difference between the two formulas. Can you switch the two formulas between the two copied applications and reverse the outcomes? Post the formulas. What does "can't get it to work" mean - what happens?


  • 16.  RE: Is it possible to create a ""Save and Keep Working"" button from a formula URL field?

    Posted 02-06-2018 13:36
    The Formula is as follows

    "<b><font color=Red><font size=6><div style='Vibrant Success' onclick=$('#footerSaveAndKeepWorkingMenuOption').click();>>>[Values have Changed. Click Here to Update!]<<</div>"

    This works in one application and not the other.  I copied the formula from the application that does NOT work into a new field I created in the table of the Application where the formula does work and added that field to the Main Form...it works perfectly there.  So I have two fields now where it works in one application and I can't get it to Save and keep working in the other application?  The Applications are set up exactly the same way from everything I can see?


  • 17.  RE: Is it possible to create a ""Save and Keep Working"" button from a formula URL field?

    Posted 02-06-2018 13:50
    Your formula has some unbalanced tags and you are using ">" and "<" characters as part of the text. I may be possible that the HTML parser is getting messed up as there is different content on the pages of the two applications.

    Try using a stripped down formula in the application where it currently does not work:
    "<div style='Vibrant Success' onclick=$('#footerSaveAndKeepWorkingMenuOption').click()>Click Here</div>"
    The above is one line of text. If this solves the problem add your other tags one by one using balanced tags.

    Also make sure there are no spaces in the value of the onclick attribute as we are not using any quotes.


  • 18.  RE: Is it possible to create a ""Save and Keep Working"" button from a formula URL field?

    Posted 02-06-2018 13:57


  • 19.  RE: Is it possible to create a ""Save and Keep Working"" button from a formula URL field?

    Posted 02-06-2018 13:58
    I removed the space before Onclick as well...it still does not work.


  • 20.  RE: Is it possible to create a ""Save and Keep Working"" button from a formula URL field?

    Posted 02-06-2018 14:01
    Without seeing the application I have to just make guesses at this point. Delete the offending field altogether, and create a new field and retry your various fixes.


  • 21.  RE: Is it possible to create a ""Save and Keep Working"" button from a formula URL field?

    Posted 02-06-2018 14:03
    Ok thanks.  I tried to add a New field in a completely different application and paste it in there...and it doesn't work there either.  I'll putter around and see what I can come up with...I'll let you know if it gets solved.  


  • 22.  RE: Is it possible to create a ""Save and Keep Working"" button from a formula URL field?

    Posted 02-06-2018 14:21
    So you have this option "Show save & keep working" selected?



  • 23.  RE: Is it possible to create a ""Save and Keep Working"" button from a formula URL field?

    Posted 02-06-2018 14:26
    BTW, the formula should use class not style:

    "<div class='Vibrant Success' onclick=$('#footerSaveAndKeepWorkingMenuOption').click();>Save and Keep Working</div>"

    It will show up as Blue since the purple rain release.



  • 24.  RE: Is it possible to create a ""Save and Keep Working"" button from a formula URL field?

    Posted 02-06-2018 14:46
    Ok...that's embarrassing.  I forgot the form setup does not automatically default to Save and Keep Working.  That has to be done before trying this awesome formula out.  Very sorry for wasting your time...thanks again.


  • 25.  RE: Is it possible to create a ""Save and Keep Working"" button from a formula URL field?

    Posted 02-06-2018 15:10
    No problem - I have to answer a number of mundane questions like this so the forum censor does not wholesale delete my more radical posts dealing with QuickBase customization and scripting  (which reveal awesome new capabilities and the future of Quickbase) and my favorite pastime of decoding the Voynich manuscript


  • 26.  RE: Is it possible to create a ""Save and Keep Working"" button from a formula URL field?

     
    Posted 25 days ago
    So is there a way for this to do the following:
    I need a button (currently an URL Formula Field) to check a box and make another field blank while prompting a dialog box that will confirm we actually want to do this. It is working fine but if I make any changes to any other field prior to clicking this button I get an error. So maybe if the button can "save and keep working"and then check the box and then redirect, that might fix the issue?
    Formula being use right now below

    "javascript:if(confirm ('Are you sure you want to release this order?')){location.assign('/db/" & Dbid() &
    "?act=API_EditRecord&apptoken=xxxxxxxxxx&rid=" & [Record ID#] & "&_fid_234=1&_fid_605=&rdr=" &
    URLEncode(URLEncode(URLRoot() & "db/" & Dbid() & "?a=td") & "") & "')}"


    ------------------------------
    Leo Leo
    ------------------------------



  • 27.  RE: Is it possible to create a ""Save and Keep Working"" button from a formula URL field?

    Posted 12-28-2017 21:42
    Wow, I will need to try that trick myself.
    Thx for the Boxing week Christmas Present. 


  • 28.  RE: Is it possible to create a ""Save and Keep Working"" button from a formula URL field?

    Posted 12-28-2017 21:54
    Well I have a truckload (100s) of similar techniques for which I just need a kitschy name, an image macro or some other gimmick in order to promote the technique. Just get me the raw concept and I will get you the technical solution. Something creative like this:




  • 29.  RE: Is it possible to create a ""Save and Keep Working"" button from a formula URL field?

    Posted 01-29-2018 17:13
    This works great. But, how can I activate the Save & keep working feature from the header? Using "onclick=$('#saveButton')" as mentioned above activates the normal save function which I've set to redirect to an error message because I have created my own own 'save' and 'apply changes' buttons
    And, using  "onclick=$('#footerSaveAndKeepWorkingMenuOption')" only works if the footer is added to the form. I'd prefer not to have it there.


  • 30.  RE: Is it possible to create a ""Save and Keep Working"" button from a formula URL field?

    Posted 01-29-2018 17:15
    #saveAndKeepWorkingMenuOption


  • 31.  RE: Is it possible to create a ""Save and Keep Working"" button from a formula URL field?

    Posted 01-29-2018 19:41
    Got it! Thanks!


  • 32.  RE: Is it possible to create a ""Save and Keep Working"" button from a formula URL field?

    Posted 02-21-2018 17:48
    Here's a cleaner way to do this, replicating the color and style of the standard 'Save & keep working button' while allowing it to be placed anywhere on the form:

    1) In the form properties, check the box to "Show save & keep working choice." (It's not necessary to also check the box to show the save and cancel buttons at the bottom of the form. That's optional.)

    2) Create a global variable for your app at Setting >> Variables ... Let's say you call it "mySaveKeepWorking" or something similar ... and give it exactly the following value (the quotes are critical!)

    <a class='Vibrant' style='font-size:14px; color:white; background:#6BBD57; white-space:nowrap;' onclick='$("#saveAndKeepWorkingMenuOption").click();'>Save & keep working</a>

    3) In your table, create a rich text variable ... say it's called "mySKW" and give it exactly and only the following value:

    [mySaveKeepWorking]

    4) In your form, place the mySKW field wherever you want, as often as you like. Each time, be sure to check the box for "Use Alternate Label Text" while leaving the value blank, and to set the form-row for "edit and add" modes.

    When you save the form, Quick Base will ask you to confirm that you really do want the mySKW field to appear multiple times, which you do!

    That's it. One wrinkle: it might be nice to have mySKW return to the same spot on the form where it was clicked. That's doable but a bit fancier. Post back here if interested.


  • 33.  RE: Is it possible to create a ""Save and Keep Working"" button from a formula URL field?

    Posted 02-21-2018 17:54
    Thx for posting. Is there similar syntax for a (regular) Save button?


  • 34.  RE: Is it possible to create a ""Save and Keep Working"" button from a formula URL field?

    Posted 02-21-2018 18:13
    Alex's formula:
    <a class='Vibrant' style='font-size:14px; color:white; background:#6BBD57; white-space:nowrap;' onclick='$("#saveAndKeepWorkingMenuOption").click();'>Save & keep working</a>
    can be shortened to this (not tested):
    <a class='Vibrant' style='font-size:14px; color:white; background:#6BBD57; white-space:nowrap;' onclick='saveAndKeepWorkingMenuOption.click();'>Save & keep working</a>
    It is a little know fact (to even seasoned developers) that modern browsers automatically create a global variable named after every attribute id in the page. So in the above formula instead of using a jQuery selector and jQuery's click() method, you can use native JavaScript and a raw reference to the global variable saveAndKeepWorkingMenuOption.

    This can be applied to Mark's inquiry as well. These two fragments are essentially equivalent:
    <a class='Vibrant' style='font-size:14px; color:white; background:#6BBD57; white-space:nowrap;' onclick='$("#saveButton").click();'>Save & Nothing More</a>
    <a class='Vibrant' style='font-size:14px; color:white; background:#6BBD57; white-space:nowrap;' onclick='saveButton.click();'>Save & Nothing More</a>


  • 35.  RE: Is it possible to create a ""Save and Keep Working"" button from a formula URL field?

    Posted 02-21-2018 18:17
    Yes. You could make three global variables, one for each of the possible values on the drop-down in the standard green save button.

    the field "mySC" would use [mySaveClose] which would have #saveMenuOption

    the field "mySN" would use [mySaveNext] would have #saveAndNextMenuOption

    ... instead of #saveAndKeepWorkingMenuOption ... otherwise everything is identical.

    Quick Base could change these, of course, but that seems low-probability for now. You can find them by using the developer tools in your browser to inspect the source code for a page, and doing ctrl-F for "#save" ...


  • 36.  RE: Is it possible to create a ""Save and Keep Working"" button from a formula URL field?

    Posted 02-21-2018 18:21
    > You could make three global variables,

    The browser creates these global variables automatically. All you have to do is use them!

    This part of my message may have been clipped:

    This can be applied to Mark's inquiry as well. These two fragments are essentially equivalent:
    <a class='Vibrant' style='font-size:14px; color:white; background:#6BBD57; white-space:nowrap;' onclick='$("#saveButton").click();'>Save & Nothing More</a>
    <a class='Vibrant' style='font-size:14px; color:white; background:#6BBD57; white-space:nowrap;' onclick='saveButton.click();'>Save & Nothing More</a>
    This technique comes in handy when referencing fields on new and edit forms. Instead of this:
    $("_fid_6")[0]
    or
    document.getElementById("_fid_6")
    you can just use this:

    _fid_6


  • 37.  RE: Is it possible to create a ""Save and Keep Working"" button from a formula URL field?

    Posted 02-21-2018 18:44
    Haven't tested the 'Save & Nothing More' idea, but looking at the HTML, I am wondering if it will do Save & close OR Save & next OR Save & keep working ... depending on what the user last selected from the save button menu ??? (Save & close would be the default, if the user had never selected another option.)


  • 38.  RE: Is it possible to create a ""Save and Keep Working"" button from a formula URL field?

    Posted 09-13-2018 13:57
    have mySKW return to the same spot on the form where it was clicked. That's doable but a bit fancier. Post back here if interested.

    I'm interested in this


  • 39.  RE: Is it possible to create a ""Save and Keep Working"" button from a formula URL field?

    Posted 11-11-2018 21:08
    Could you please let me know how you get it back to the same spot? I am very much in need of that behavior