Forum Discussion

AndrewPatricio1's avatar
AndrewPatricio1
Qrew Member
9 months ago

"save and keep working" rich text button working in add but not edit form

I used the code sample from this QB resource site link to create a custom formula rich text field that allows me to place multiple "save and keep working" buttons throughout my form.  Works like a charm as an admin but for a more restricted user role it has consistently weird behavior. 

For this other role it works fine when I'm adding a new record but when I'm editing a record, it doesn't work for file attachment fields only.  ie, any other regular field works fine and file attachment fields work fine when I'm adding just not editing.  Even stranger, the standard built-in save and keep working drop down in the green button at the bottom of the form works fine in both edit and add modes for this role.

Only in edit mode for this role does this behavior occur and it occurs consistently.  For a minute it seemed to work okay in Chrome but not MS edge but now it exhibits this odd behavior for any browser.   It also works fine as an admin for any browser.  

Any suggestions?  I submitted a support case but am also asking here.  

thanks for any help.

Andrew

code from the link above in case it doesn't work. Using this exactly.

var text rid = 
    If([Record ID#]>0,
        ToText([Record ID#]), // Record ID already exists
        "%%rid%%" // New record, no Record ID exists yet
    )
;
var text url = URLRoot() & "db/" & Dbid() & "?a=er&rid=" & $rid;

"<a class='Vibrant Primary SaveBeforeNavigating' data-replaceRid=true href='" & $url & "'>Save & Keep Working - Rich Text</a>"



------------------------------
Andrew Patricio
------------------------------

2 Replies

  • This technique is known to not work If the only change to the record is within grid edit children. Based on your note above, it may also not work if a file is edited.

    The problem is that the parent form is not detecting a change.

    The way I get around this is that I make a numeric field called dummy field.  Then I make another field with the formula of dummy field plus one. Then I have a Form Rules that says whenever the Dummy field it's not equal to the dummy field plus one change the value of dummy field to dummy field plus one. This ensures that whenever the record his opened in edit mode that the parent record will be dirtied. Then the Save and keep navigating will work.

    I suggest you try that technique and see if it deals with the weirdness you are experiencing. I know that you were saying this is real specific, but maybe it just depends on how the record of being edited.   



    ------------------------------
    Mark Shnier (Your Quickbase Coach)
    mark.shnier@gmail.com
    ------------------------------
    • AndrewPatricio1's avatar
      AndrewPatricio1
      Qrew Member

      Thanks, I will try this but another odd thing is that this is not an issue using the same form with an admin role.   Plus it also works with the built in green button "save & keep working" at the bottom of the form.   

      Though if what you describe is true, the if I edit any other field it should "dirty" the record and the file attachment should save.  I'm pretty sure that is not happening, the file attachment just won't save when I use the custom button.

      Having said this, really appreciate your pointers.  I will play around with your suggestion and see if I can get it to work.

      Andrew



      ------------------------------
      Andrew Patricio
      ------------------------------