Date stamp from a grid edit checkbox

  • 0
  • 1
  • Question
  • Updated 4 months ago
  • Answered
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.
Photo of bgstatdex

bgstatdex

  • 270 Points 250 badge 2x thumb

Posted 4 months ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,316 Points 50k badge 2x thumb
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.
Photo of bgstatdex

bgstatdex

  • 270 Points 250 badge 2x thumb
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"
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,316 Points 50k badge 2x thumb
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);"
Photo of Barry Gulino

Barry Gulino

  • 70 Points
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);"
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,316 Points 50k badge 2x thumb
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());
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 26,512 Points 20k badge 2x thumb
That style of formula construction uses a formula variable named URL. You are using $URL but not defining it.
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 26,512 Points 20k badge 2x thumb
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.
Photo of Barry Gulino

Barry Gulino

  • 70 Points
Works!  Sorry I was just focusing on the disprec item that I didn't see you changed other items.  Thank you!
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,316 Points 50k badge 2x thumb
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)