Forum Discussion

BarryGulino's avatar
BarryGulino
Qrew Cadet
7 years ago

Date stamp from a grid edit checkbox

I have a list of tasks that are automatically created when a transaction is created. The tasks are child records that are shown in a report in a tab for the main transaction form. As the tasks are completed the user opens the task and inputs a completion date. The task then moves to an adjacent table in the same tab. As the tasks are completed the list gets smaller. Once the list is gone you are done. It can be as many as 39 tasks so grid edit of the report is useful. What I would like is for the user to be able to open the report in grid edit and check off check boxes with label complete. Then once saved it would stamp the completion date with the current date. I?ve looked and can?t seem to find anything on point.
  • I suggest using an ACTION. They will fire in Grid Edit mode. https://help.quickbase.com/user-assis...

    The trick here is that you need the Action to edit the record which triggered the action, and to do that you need to make a report link field of the record to itself. Configure [Record ID#] on the left to navigate back to the same app, same table same field [Record ID#] on the right.
  • I tried an ACTION first, but like you said, it did not have an edit option. I would need you to explain in more detail on the report link field if that�s ok.

    I also tried this Formula URL and it works directly on the form, but the �disprec=1� sends me to the record. I want to be sent back to the form that houses the report. Any idea on how to make that work?

    URLRoot() & "db/" & Dbid()
    & "?act=API_EDITRecord&rid=" & [Record ID#]
    & "&apptoken="xxxxx"
    & "&_fid_81=" & Now()
    & "&disprec=1
  • The trick with the editing of the record you are on is to make a Report Link field.  Just try what i suggested above and let me know if you get stuck.

    Try this as code to make and edit and refersh the page you are on.


    var text URL = URLRoot() & "db/" & Dbid() 
    & "?act=API_EDITRecord&rid=" & [Record ID#] 
    & "&apptoken="xxxxx" 
    & "&_fid_81=" & Now();


    "javascript:" &
    "$.get('" &
    $URL &
    "',function(){" &
    "location.reload(true);" &
    "});" & "void(0);
  • I'm getting an error message "There are extra characters beyond the end of the formula."

    This is my actual entry:

    URLRoot() & "db/" & Dbid() 
    & "?act=API_EDITRecord&rid=" & [Record ID#]
    & "&_fid_36=" & Today();
    "javascript:" &
    "$.get('" &
    $URL &
    "',function(){" &
    "location.reload(true);" &
    "});" & "void(0);
  • That style of formula construction uses a formula variable named URL. You are using $URL but not defining it.
  • Please use the formula i suggested.

    It sets up a formula variable called URL and then that javascript code refers to that formula variable.

    You left out the 

    var text URL =

    also in this line I suggest using

    & "&_fid_36=" & URLEncode(Today());
  • BTW, you don't need this part:
     & "void(0);"

    This common error is being propagated by formula / script kiddies who just copy and paste prior answers.
  • Works!  Sorry I was just focusing on the disprec item that I didn't see you changed other items.  Thank you!
  • Great,
    So that magic of that javascript is that it will refresh the page - meaning the record or the report that you are on, so very handy.

    You set up that formula URL to do one API call and then the javascript runs that 1 API and refreshes the page.

    There is an alternate code like this

    "javascript:" &
    "$.get('" & 
    $url & 
    "',function(){" &
    "$.jGrowl('This Item has been put on PO CANCEL snooze', {life: 5000, theme: 'jGrowl-green'});" &
    "});" &
    "void(0);"

    which does not refresh the page but rather puts up a quiet fade away pop up message for, in this case 5 seconds (5000 miliseconds)