Keep filter after JavaScript reload function

  • 0
  • 1
  • Question
  • Updated 6 months ago
  • In Progress
I am using the reload function of javascript in order to reload the page after clicking a url button.

Is there any way to keep the filters on the report after clicking the url button?

"<a class=\"Vibrant Success\" href=\"javascript:" & "$.get('" & $url &
    "', function(){" & "location.reload();" & "});" &
    "void(0);\">Mark As Done</a>")

Thanks
Photo of Micro Dev

Micro Dev

  • 1,576 Points 1k badge 2x thumb

Posted 6 months ago

  • 0
  • 1
Can you try this as a formula URL field type labelled "Mark as Done" and see if it retains the DF?

"javascript:" &
"$.get('" & 
$URL & 
"',function(){" &
"location.reload(true);" &
"});" 
& "void(0);"
Photo of Micro Dev

Micro Dev

  • 1,576 Points 1k badge 2x thumb
Thanks for the quick reply. I need this to be a rich text field since I am using more logic in this button. In a regular url button I can't change the text of the button based on the case.

I only shared the javascript part but here is my full formula:

var text editUrl =URLRoot() & "db/" & Dbid() & "?act=er&rid=" & [Record ID#];

var text url=
URLRoot()&"DB/"&Dbid()&"?A=API_EditRecord&apptoken=[mytoken]&RID="&[Record ID#]
&"&_fid_23="&URLEncode("today")
&"&_fid_19=Done";

If([CanMarkDone]=false,"<a class=\" Vibrant Alert \"href="& $editUrl &">"&[Why Can't Mark Done]&"</a>",

"<a class=\"Vibrant Success\" href=\"javascript:" & "$.get('" & $url &
    "', function(){" & "location.reload();" & "});" &
    "void(0);\">Mark As Done</a>")
Sorry, I don't know the answer to that.
.. but I would like to ...
Photo of Micro Dev

Micro Dev

  • 1,576 Points 1k badge 2x thumb
Thanks let's see if someone can come up with anything...