Forum Discussion

ARademacherARad's avatar
ARademacherARad
Qrew Member
11 years ago

URL Formula Button Refresh current page not Redirect

What I have now is an application dashboard for our Director to select a name of a manager. Then it takes them to individual Dashboards with ALL of the reports for that one manager on the page for employee performance metrics (measured across multiple tables and entry points). One report on the dashboard is a "Address at the next 1:1" list. On the report i have a URL button field that changes the status from "Address" to "Closed" so that the director can just click on the button without editing each record every time just to change status and save. One click entry without leaving the dashboard view.

Since i cannot redirect to the main table dashboard (since she would have to select the name and re-enter the specific employees dashboard). I would like for the page to just refresh itself on the current dashboard. Keep in mind that i cannot code a specific dashboard since there are 40+employee dashboards each with a different URL that utilize the same table, but different reports.



Here is what i have:

URLRoot() & "db/" & Dbid () & "?act=API_EditRecord&rid=" & [Record ID#]

& "&_fid_12="&URLEncode("Closed")


& "&rdr=" & URLEncode(URLRoot() & "db/INSERT THE MAIN TABLE ID YOU CAN FIND THIS BY CLICKING HOME") <--I cannot use this because i want to just refresh current page





Found this suggestion on further research, but it gives me "Formula Syntax Errors" when i add this to the bottom of the code below

"javascript:" &

"$.get('" &


$URL &


"',function(){" &


"location.reload(true);" &


"});"


& "void(0);"




Any help is greatly appreciated

  • I have an if statements set up, like the following, how would I apply this java to this?

    If([Status]="Ready to Start",
    URLRoot() & "db/" & Dbid () & "?act=API_EditRecord&rid=" & [Record ID#]
    & "&apptoken=b2ef6ijciijsibdf9dftgdjtdhm3"
    & "&_fid_15="&URLEncode("In Progress")
    & "&_fid_284="&URLEncode(Today())
    & "&rdr=" & URLEncode(URLRoot() & "db/bkpvkgvbb"),

    [Status]="In Progress",
    URLRoot() & "db/" & Dbid () & "?act=API_EditRecord&rid=" & [Record ID#]
    & "&apptoken=b2ef6ijciijsibdf9dftgdjtdhm3"
    & "&_fid_15="&URLEncode("Completed")
    & "&_fid_285="&URLEncode(Today())
    & "&rdr=" & URLEncode(URLRoot() & "db/bkpvkgvbb")
    & "&_fid_29="&URLEncode(Today()), null)
  • OK, so now I am confused as to what you real question is.

    What are you trying to do that is not working?  This technique does not support the "rdr=" ....
  • Sorry. I really just want each time a person clicks to change the status button that the page refresh and stay on the same page. Can I still use this code? If so, how would I use it?
  • Try this
    var text URL =
    If([Status]="Ready to Start",
    URLRoot() & "db/" & Dbid () & "?act=API_EditRecord&rid=" & [Record ID#]
    & "&apptoken=b2ef6ijciijsibdf9dftgdjtdhm3"
    & "&_fid_15="&URLEncode("In Progress")
    & "&_fid_284="&URLEncode(Today()),

    [Status]="In Progress",
    URLRoot() & "db/" & Dbid () & "?act=API_EditRecord&rid=" & [Record ID#]
    & "&apptoken=b2ef6ijciijsibdf9dftgdjtdhm3"
    & "&_fid_15="&URLEncode("Completed")
    & "&_fid_285="&URLEncode(Today())
    & "&_fid_29="&URLEncode(Today()));


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

    please check the code for the In progress - are you wanting to update two different date fields?
  • :) the nice thing about that technique is that it will work on any record or report and not need multiple buttons.
  • Hi Everyone:

    Would this be sufficient to have the auto refresh happen?

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

    Or does it need the everything that proceeded?  This is what my existing button looks like:

    var  text  pdfid = Case([Company], "UMB", "8", "9");var  text  fname = Case([Company], "UMB", "UMB Assignment Form", "Assignment Form");
    "javascript:void(window.open('" &
    "https://www.aws-juiced-client2.com/CompleteMedical_946/PDF Stamper/Default.aspx?"
    & "clientid=Q946"
    & "&appid=bkkhaw4q7"
    & "&msdb=" & Dbid()
    & "&msid=" & [Patient Number]
    & "&tpdbid=" & [_DBID_DOCUMENT_TEMPLATES]
    & "&tpid="  &$pdfid
    & "&faid=444"
    & "&apptoken=cidsvuqba48bsbbdntgghv5dzec"
    & "&fn="&$fname
    & "&pdfdte="
    & "&rsfid=14"
    &"','copy','top=40,left=320,width=730,location=no,menubar=no,toolbar=no,status=yes'))"


    So should I just add the javascript after that?  

    Thanks in advance!
    • MCFNeil's avatar
      MCFNeil
      Qrew Captain
      I could be wrong, but I don't think you can run 2 JavaScript actions in one button...
      In this situation I don't think you'll be able to use the standard reload with this.

      You main formula is already using a "window.open" call, so you would need to include a close function as part of that main call.

      something like
      {if (a.closed) {window.location.reload();}}

      but I'm not 100% of the syntax in your situation.
  • The developer I'm working with found a workaround.  THANKS!
  • I'm interested in modifying the javascript above to include a location redirect in the script. 

    var text DisplayRecord=
    URLRoot() & "db/" & [_DBID_TASKS_POC]
    & "?a=td";

    "javascript:" & 
    "$.get('" & $AddRecordOne & "').then(function(){" &
    "$.get('" & $AddRecordTwo & "').then(function(){" &
    "$.get('" & $AddRecordThree & "').then(function(){" &
    "$.get('" & $AddRecordFour & "').then(function(){" & 
    "$.get('" & $AddRecordFive & "').then(function(){" &
    "$.get('" & $AddRecordSix & "').then(function(){" &
    "$.get('" & $AddRecordSeven & "').then(function(){" &
    "$.get('" & $AddRecordEight & "').then(function(){" &
    "$.get('" & $AddRecordNine & "').then(function(){" &
    "$.get('" & $AddRecordTen & "').then(function(){" &
    "})" & 
    "})" & 
    "})" & 
    "})" & 
    "})" & 
    "})" & 
    "})" & 
    "})" & 
    "})" & 
    "});"
    & "void(0);"

    Where do I insert $DisplayRecord? I've tried numerous different spots, can't get it to work. Thanks in advance!