Discussions

Expand all | Collapse all

Auto-Fill an end date?

  • 1.  Auto-Fill an end date?

    Posted 04-03-2017 15:58
    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();"&
    "});


  • 2.  RE: Auto-Fill an end date?

    Top
    Contributor
    Posted 04-03-2017 16:34
    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?


  • 3.  RE: Auto-Fill an end date?

    Posted 04-03-2017 16:37
    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


  • 4.  RE: Auto-Fill an end date?

    Top
    Contributor
    Posted 04-03-2017 16:43
    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();"&
    "});


  • 5.  RE: Auto-Fill an end date?

    Top
    Contributor
    Posted 04-03-2017 17:21
    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.



  • 6.  RE: Auto-Fill an end date?

    Top
    Contributor
    Posted 04-03-2017 17:31


  • 7.  RE: Auto-Fill an end date?

    Top
    Contributor
    Posted 04-03-2017 17:39


  • 8.  RE: Auto-Fill an end date?

    Posted 06-23-2017 17:37
    I was looking to auto populate a date/time field from a button. Your code had what I needed ---Thanks!