Auto-Fill an end date?

  • 1
  • 1
  • Question
  • Updated 1 year ago
  • In Progress
Hey, guys, I'm pretty new to QuickBase, but I currently have a button that sets the status of a task to "Complete" and redirects to the table view (where you originally clicked the button)

I tried to use a form rule that would Auto-Fill the end date with today's date once the status changes to complete, but it isn't cooperating with the button. So the status will change but it won't populates the date. 

Can I get my current "complete" button to populate the date too?

Here's the button code, thanks!

var text url=
URLRoot()& "db/" &Dbid()& "?a=API_EditRecord" & 
"&rid=" & [Record ID#]&
"&apptoken=cn3eu67ch3m9b76jdmn5b7vzn6d"&
"&_fid_10=Complete";

"javascript:" &
"$.get('" & 
$url & 
"',function(){" &
"location.reload();"&
"});"
Photo of Manny De La Cruz

Manny De La Cruz

  • 940 Points 500 badge 2x thumb

Posted 2 years ago

  • 1
  • 1
Photo of Matthew Neil

Matthew Neil

  • 31,478 Points 20k badge 2x thumb
Form rules only work while manually editing the form.  

You'll need to add the date field to your code above.  

What is the field ID of the date field you are wishing to populate?
Photo of Manny De La Cruz

Manny De La Cruz

  • 940 Points 500 badge 2x thumb
Thank you for the reply!

See, I didn't know that about QuickBase, 

The field ID of the date field I want to populate is "9"
Photo of Matthew Neil

Matthew Neil

  • 31,478 Points 20k badge 2x thumb
Insert this into your equation;

"&_fid_9="&URLEncode(Today())

So it will look like this...

var text url=
URLRoot()& "db/" &Dbid()& "?a=API_EditRecord" & 
"&rid=" & [Record ID#]&
"&apptoken=cn3eu67ch3m9b76jdmn5b7vzn6d"&
"&_fid_10=Complete"&
"&_fid_9="&URLEncode(Today())
;

"javascript:" &
"$.get('" & 
$url & 
"',function(){" &
"location.reload();"&
"});"
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 27,694 Points 20k badge 2x thumb
Thanks for the sloppy formula - I modified my grammar to allow whitespace before the closing semicolon on formula variable declarations. Keep posting formulas (a) with errors, (b) without errors or (c) with sloppy formatting and I will keep patching the grammar.

(Edited)
Photo of Jason

Jason

  • 1,022 Points 1k badge 2x thumb
I was looking to auto populate a date/time field from a button. Your code had what I needed ---Thanks!