Forum Discussion

EOMDevelepors's avatar
EOMDevelepors
Qrew Captain
7 years ago

Keep filter after JavaScript reload function

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
  • 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);"
  • 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>")