So I decided to clear all my previous attempts and recreated a formula rich text field and placed the following code:
var text rid =
If([CID]>0,
ToText([CID]), // 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 & Refresh Pricing</a>"
I am no longer getting an error. Yay! The form refreshes and my pricing fields are update, however, one of the ways a user would access this form is from an embedded report. When they click on the pencil icon or the eye icon the form opens as a subform popup screen. But after click the new button, the form refreshes as a full window form. Upon saving, it does return to the parent record it originally launched from. Is there any way to configure the button to refresh but stay as the popup form?
I attempted to add "data-height=200 data-width=200" in the a class statement, but that didn't do anything.