Forum Discussion

ChrisMacFarlane's avatar
ChrisMacFarlane
Qrew Trainee
8 years ago

Update all records in a specific report

I have a payroll application that's being developed.  I need to take the records which have been approved and export them to be sent to the 3rd party payroll provider.  At some point before/after the export, I need to change the status of all the records in a given report from Approved to Submitted, and add a timestamp in one field.  Each manager would have their own report showing the Approved records, but I can't figure out how I can have all those records modified with some automation (I don't want to use grid edit or anything else that's manual).

14 Replies

  • I'm not sure what the "Multiple Steps" are but you can make a simple formula URL button to Toggle check the box and then trigger the ACTION when the checkbox is changed.

    This should work to do that

    // make a formula variable to be the opposite of the checkbox condition.
    var bool NewValue = not [my checkbox field] 


    var text URL =
    URLRoot() & "db/" & Dbid () & "?act=API_EditRecord&rid=" & [Record ID#]
    & "&_fid_55=" & URLEncode($NewValue);

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

     Change the 55 to the field ID of you checkbox field.

    Change the ACTION to trigger on any time the check box is checked.

    Take the checkbox off the form and just show the URL button in View mode.
  • I have the formula (I had to add ; after the [Process for Submission]. 
    // make a formula variable to be the opposite of the checkbox condition.
    var bool NewValue = not [Process for Submission] ;


    var text URL =
    URLRoot() & "db/" & Dbid () & "?act=API_EditRecord&rid=" & [Record ID#]
    & "&_fid_9=" & URLEncode($NewValue);

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

    The button is on the form and when clicked it re-loads the page but the value of the checkbox doesn't change.
  • The problem is probably not having supplied an application token.

    you can test that by commenting out or temporarily removing that whole JavaScript block and just replacing it with

    $URL

    That will run the URL formula and expose the error message

    If that is the problem, you can read the help on Application Tockens and decide if you want to use them.

    If you don't, you can disable their need in Settings, for the Application, and App Properties.

    Else the formula will need adjusting to add a line just before the semicolon

    & "apptoken=xxxxxxxxxxxx";