Discussions

Expand all | Collapse all

Create a Button to Change a Date Field

QuickBaseCoach Dev./Training09-29-2017 19:09

QuickBaseCoach Dev./Training10-05-2017 03:31

  • 1.  Create a Button to Change a Date Field

    Posted 09-29-2017 19:01
    I would like to have a Button that will update a Date Field with the Current Date. This would update all the Records with the Current Date. Is this Possible?


  • 2.  RE: Create a Button to Change a Date Field

    Posted 09-29-2017 19:09
    When you say "all the records"  - Which Records?


  • 3.  RE: Create a Button to Change a Date Field

    Posted 09-29-2017 19:20
    Ok, I have a table that I want to affect each record in that table meaning a Modify.  So I might have 20 records in the Table and I have a Generated Date.  I want to have a Button that will Loop through all 20 records and update the Generate Date with Today's Date.  

    Possible?


  • 4.  RE: Create a Button to Change a Date Field

    Posted 09-29-2017 19:30
    So if the table has 1000 records, you want to update all 1,000 records?  Or do you really mean that you have a report with 20 records out of 1,000 records and just want to update those ones.


  • 5.  RE: Create a Button to Change a Date Field

    Posted 09-29-2017 20:14
    Yes, I am focused on updating the Table.  Maybe the most it will have is 100 records.  


  • 6.  RE: Create a Button to Change a Date Field

    Posted 09-29-2017 20:17
    How about Grid Edit.
    Let's start low tech.

    Go to Grid Edit.
    Put a T for today in the date field.
    Click on the column heading to highlight the column,
    Right click to Fill down,
    Save


  • 7.  RE: Create a Button to Change a Date Field

    Posted 09-29-2017 20:21
    Yes, I can do that.  Maybe that's the easy way for now.   


  • 8.  RE: Create a Button to Change a Date Field

    Posted 09-29-2017 20:47
    This works ok.  Thanks. 
    Would be nice to have a Button to call an Action to handle this.  
    Fewer Steps.  
    Thanks for the Help.


  • 9.  RE: Create a Button to Change a Date Field

    Posted 09-29-2017 20:51
    It is possible to make a button to do that.  Contact me via the information in my profile if you want assistance with that.

    Basically we would use API_RunImport to import the records into themselves and update that 1 field and then land the user on the Table Home page. 


  • 10.  RE: Create a Button to Change a Date Field

    Posted 09-29-2017 22:58
    Attached is a screenshot of applying a console script to change the date of all records in a query. This can easily be implemented as a button and you are free to try it in the Mass Update application by changing the date in the script.

    https://i.imgur.com/Yyw928H.jpg

    ">https://d2r1vs3d9006ap.cloudfront.net/s3_images/1655973/RackMultipart20170929-45724-nqnrw-screenshot_inline.jpg?1506726461">
    Mass Update
    https://haversineconsulting.quickbase.com/db/bm5hy8d2z

    Pastie Database
    https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=604


  • 11.  RE: Create a Button to Change a Date Field

    Posted 09-29-2017 23:10
    There is a small inconsistency  in the image above regarding the date in the script and the displayed date in the report as I was repeatedly modifying the date in the console to test the script - it works and it works well.

    FWIW, I type these scripts directly into the console and have a lot of other shortcut methods to speed up development and for drill. So I sometimes gloss over details when I post. Feel free to ask if you have questions.


  • 12.  RE: Create a Button to Change a Date Field

    Posted 09-30-2017 18:37
    Another option is to use the "Search & Replace" option.  When you have a table report pulled up, you can apply any filtering you'd like. 

    Then select the "more" menu option and "Search & Replace".

    This would let you pick the field and mass update.

    (small caveat is that you have to search for a particular value to replace, so grid edit might work too)
    Just wanted to give you another idea. 


  • 13.  RE: Create a Button to Change a Date Field

    Posted 10-04-2017 19:22
    Would this "link" be similarly used to create a button field on each record individually to change the field value of say a status text field/dropdown. Click button - sets field to Active/Inactive for instance. As a toggle....?


  • 14.  RE: Create a Button to Change a Date Field

    Posted 10-05-2017 03:31
    Please post this as a new question.