DawnQuitschau
4 years agoQrew Member
Refresh Current Page After Save & Keep Working
I have a table (Assets) with a custom key called Asset ID (default value of 1). In order to set Asset ID, I am using a calculated field (temp id) that is
set to Record ID# + 10M (Asset ID is used by an external system and needs to be a large number). I have a pipeline that runs when a record is created in the Assets table that has an Asset ID of 1. The pipeline updates the Asset ID to the value in temp id.
When the user enters a new Asset (completes the form and saves it), I would like the Asset ID to be displayed on the form. To complicate this a little more, I have a child table (Versions) and on the Assets form, there are tabs for both Asset and Versions (an Asset can have many versions). The Versions tab contains an embedded report of all associated Versions (blank initially) and it also includes the Asset ID. The pipeline that runs to update the Asset ID also creates a Versions child record, which contains some basic information from the parent (including Asset ID). So, the end goal is to have Asset ID visible on both the Asset and Versions tabs. Currently, when a record is saved, I have both the Record ID# and temp id in hand. However, in order for the Asset ID and Versions child record to display, I have to refresh my browser window. My goal is to get them to display without the user having to take any additional actions (aside from the initial save of the record).
I am currently playing with a custom "save and keep working" button and am trying to add a page refresh following the save, but I can't seem to force a page refresh. I'm a relative newbie and am trying some things I've found on Community. (Questions - when should I use URLENCODE? And what does rdr do (redirect?)?)
var text rid =
If([Record ID#]>0,
ToText([Record ID#]),
"%%rid%%"
)
;
// create Edit Record URL & RefreshPage variables
var text url = URLRoot() & "db/" & Dbid() & "?a=er&rid=" & $rid;
var text RefreshPage = URLRoot() & "db/" & Dbid() & "?a=doredirect&z=" & $url;
//var text RefreshPage = URLRoot() & "db/" & Dbid() & "?a=doredirect&z=" & Rurl();
"<a class='Vibrant Primary SaveBeforeNavigating' data-replaceRid=true href='" & $url & "&rdr=" & $RefreshPage & "'>Save & Keep Working - Rich Text</a>"
// "<a class='Vibrant Primary SaveBeforeNavigating' data-replaceRid=true href='" & $url & "&rdr=" & URLENCODE($RefreshPage) & "'>Save & Keep Working - Rich Text</a>"
------------------------------
Dawn Quitschau
------------------------------
set to Record ID# + 10M (Asset ID is used by an external system and needs to be a large number). I have a pipeline that runs when a record is created in the Assets table that has an Asset ID of 1. The pipeline updates the Asset ID to the value in temp id.
When the user enters a new Asset (completes the form and saves it), I would like the Asset ID to be displayed on the form. To complicate this a little more, I have a child table (Versions) and on the Assets form, there are tabs for both Asset and Versions (an Asset can have many versions). The Versions tab contains an embedded report of all associated Versions (blank initially) and it also includes the Asset ID. The pipeline that runs to update the Asset ID also creates a Versions child record, which contains some basic information from the parent (including Asset ID). So, the end goal is to have Asset ID visible on both the Asset and Versions tabs. Currently, when a record is saved, I have both the Record ID# and temp id in hand. However, in order for the Asset ID and Versions child record to display, I have to refresh my browser window. My goal is to get them to display without the user having to take any additional actions (aside from the initial save of the record).
I am currently playing with a custom "save and keep working" button and am trying to add a page refresh following the save, but I can't seem to force a page refresh. I'm a relative newbie and am trying some things I've found on Community. (Questions - when should I use URLENCODE? And what does rdr do (redirect?)?)
var text rid =
If([Record ID#]>0,
ToText([Record ID#]),
"%%rid%%"
)
;
// create Edit Record URL & RefreshPage variables
var text url = URLRoot() & "db/" & Dbid() & "?a=er&rid=" & $rid;
var text RefreshPage = URLRoot() & "db/" & Dbid() & "?a=doredirect&z=" & $url;
//var text RefreshPage = URLRoot() & "db/" & Dbid() & "?a=doredirect&z=" & Rurl();
"<a class='Vibrant Primary SaveBeforeNavigating' data-replaceRid=true href='" & $url & "&rdr=" & $RefreshPage & "'>Save & Keep Working - Rich Text</a>"
// "<a class='Vibrant Primary SaveBeforeNavigating' data-replaceRid=true href='" & $url & "&rdr=" & URLENCODE($RefreshPage) & "'>Save & Keep Working - Rich Text</a>"
------------------------------
Dawn Quitschau
------------------------------