"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
------------------------------