Discussions

Expand all | Collapse all

Date stamp formula for checkbox

  • 1.  Date stamp formula for checkbox

    Posted 04-24-2017 12:59
    Hello.

    I have a quick question regarding date stamps.

    I have two check-boxes on my form: import and export. For both, I hope to create a formula date stamp field to see when users ticked these boxes.

    We have a few older records to see when they were imported and exported. When they built this application, they did not anticipate the importance of these check-boxes.

    Is this at all possible? 

    Thank you very much for all of your help!


  • 2.  RE: Date stamp formula for checkbox

    Posted 04-24-2017 13:08
    if the data entry is being dome via the form and never by grid edit, then you can create two fields to hold the date the checkboxes were checked.

    Use a form rule such as

    CONDITIONS:
    when multiple conditions are true.
    checkbox 1 is checked
    date checkbox 1 checked is blank.

    ACTION

    change date checkbox 1 checked to the current date.

    Be sure to uncheck the box at the bottom of the form rule so it fires all the time.

    You will need to have two Form rules, one for each checkbox.


  • 3.  RE: Date stamp formula for checkbox

    Top
    Contributor
    Posted 04-25-2017 03:06
    Another option if you aren't going to be editing individual records on the form, is to make a formula-url field that performs an API_EditRecord function to check the box, timestamp, and even add who clicked it (if desired).

    These buttons can be used in reports, or on the form.


  • 4.  RE: Date stamp formula for checkbox

    Posted 08-20-2017 01:34
     Simple and very useful.  Do you have an example on this? 


  • 5.  RE: Date stamp formula for checkbox

    Posted 04-09-2019 00:08
    It's been a while, but Matthew can you point me in the direction of how to do this?


  • 6.  RE: Date stamp formula for checkbox

    Posted 04-09-2019 01:24
    I'm not sure if Matthew is still active on the forum.

    Here is some code to updates some fields ona record and refersh

    var date TodaysDate = Today();

    var text Update = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & [Record ID#]
    & "&apptoken=xxxxxxxxx" // you will need to decide if you want to require app tokens or just disable in App properties
     & "&_fid_100=" & $TodaysDate // put the date into fid 101
     & "&_fid_101=" & totext(User()) put who clicked into fid 102
    & "&_fid_102=1" ; set a checkbox to be true

    // then put in this code to execute the formula variable called URL and refresh the page

    var text URL = 
    "javascript:" &
    "$.get('" & 
    $Update & 
    "',function(){" &
    "location.reload(true);" &
    "});" 
    & "void(0);";



  • 7.  RE: Date stamp formula for checkbox

    Posted 04-09-2019 04:14
    Thank You! Sorry - I'm new to formula url's. Where would I enter the specific fields i want to edit/update? Just in the fid_100,101,102, etc.? Also is there any other identifier's that i would need to fill?


  • 8.  RE: Date stamp formula for checkbox

    Posted 04-09-2019 04:25
    Are there edits needed? It's giving me an expecting error.

    var date TodaysDate = Today();

    var text Update = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & [Record ID#]
    & "&apptoken=dhxpiidu5cj4edz3d8kvbn2cium"
     & "&_fid_1469=" & $TodaysDate 
     & "&_fid_1468=" & totext(User()) 
    & "&_fid_805=1" ;


    var text URL = 
    "javascript:" &
    "$.get('" & 
    $Update & 
    "',function(){" &
    "location.reload(true);" &
    "});" 
    & "void(0);";


  • 9.  RE: Date stamp formula for checkbox

    Posted 04-09-2019 10:53
    Please post the complete error message text when you save the formula.


  • 10.  RE: Date stamp formula for checkbox

    Posted 04-09-2019 10:55
    This might be the problem in the first line.

    var text TodaysDate = ToText(Today());