Quick Base Discussions

Expand all | Collapse all

Overwrite [update] a timestamp field / control a timestamp from multiple checkboxes

  • 1.  Overwrite [update] a timestamp field / control a timestamp from multiple checkboxes

    Posted 02-09-2018 17:44
    Hi all,

    I have a timestamp field that's is controlled by a checkbox-field and filled by the dynamic-rules
    "When checkbox is equal to checked than action change timestamp to current date/time"
    quite standard setup so-far.

    I have now a second checkbox that should preferably update (or overwrite) the same timestamp field.
    As you can control a field only once via a dynamic-rule I've added a second condition on the same rule.
    "Multiple conditions when any checkbox A is equal to checked or checkbox B is equal to checked than action change timestamp to current date/time"

    But this doesnt't seem to work this way.
    It seems that the rule ignores the second change in box B.
    If it helps the flow from box A to B is always in the same logical order of the delivery process.


    (my alternative would be to create timestamps for every checkbox and than formula field getting the MAX date/time value as the realtimestamp for the last checked box. But as there are quite some checkboxes inline I would prefer another approach)

    THXS JWS


  • 2.  RE: Overwrite [update] a timestamp field / control a timestamp from multiple checkboxes

    Posted 02-09-2018 17:51
    mmmm. I've found this thread and unless somebody has a brighter idea I fear it's going to be a workaround

    https://community.quickbase.com/quickbase/topics/timestamp-field


  • 3.  RE: Overwrite [update] a timestamp field / control a timestamp from multiple checkboxes

    Top
    Contributor
    Posted 02-09-2018 18:45
    Is this the behavior your want?

    Checkbox Timestamp
    https://haversineconsulting.quickbase.com/db/bnf75qdhj?a=q&qid=1

    Feel free to edit or add records.

    Don't worry about the numbers appearing in the timestamp - they are just millisecond values - easy to change for humans to read. Just lazy.

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


  • 4.  RE: Overwrite [update] a timestamp field / control a timestamp from multiple checkboxes

    Posted 02-09-2018 18:56
    Yes it looks like it's possible.
    This is probably replicatable over multiple CB's.  What is the magic behind it?


  • 5.  RE: Overwrite [update] a timestamp field / control a timestamp from multiple checkboxes

    Top
    Contributor
    Posted 02-09-2018 19:12
    the script in the pastie


  • 6.  RE: Overwrite [update] a timestamp field / control a timestamp from multiple checkboxes

    Posted 02-10-2018 00:58
    Dan, I understand the concept of this though this is a bit out of my comfortzone yet. But i'm willing to read, experiment and learn.

    I followed the instructions here https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=294 ; or I better say I tried as the outcome is different as expected.

    step1 = OK
    step2 = OK (I assumed this should be a 'code page')
    step3 = ?? (I created a field in my table named it 'test' for the time being. The type of the field is 'formula-text'. I don't undertsand the instruction: '..with some HTML allowed using this formula..' properly. I can;t find that option on a field in the table. I recognize that 'HTML allowed' from a text field in a form but I doubt what is correct here.
    I copied the '[iol] & "moduleJumpTheShark.js" & [/iol]' code in the formula section of the field
    step4 = the check instructin I don't undertsan (see step 3);  all the unchecks are clear and removed form the advanced section of the field-properties
    step5 = the field 'test'is placed on my form and I see this code on the form:
    test      <img qbu='module' src='/i/clear2x2.gif' onload="javascript:if(typeof QBU=='undefined'){QBU={};$.getScript(gReqAppDBID+'?a=dbpage&pagename=module.js&rand='+new Date().getTime())};">
    I do not see the alert alert("module.js is now loaded - I now own your page");



    Hope this make some sense and you able to see my mistake.

    Thanks JWS


  • 7.  RE: Overwrite [update] a timestamp field / control a timestamp from multiple checkboxes

    Top
    Contributor
    Posted 02-10-2018 01:33
    QuickBase likes to change things now and then to mix it up so to speak.
    • User Defined Page => Code Page
    • Text formula filed with some HTML allowed => Rich Text Formula field
    • QuickBase => Quick Base
    • Not Purple => Purple
    From your description I think you will get it working if you use a Rich Text Formula field. You are seeing the raw HTML displayed so the script specified in the onload attribute never executes and you are left with an unenhanced page. :(


  • 8.  RE: Overwrite [update] a timestamp field / control a timestamp from multiple checkboxes

    Posted 02-10-2018 03:33
    JWS

    How about trying this single Rule

    When the record is saved
    And any of the following

    Checkbox 1 has changed
    Checkbox 2 has changed

    ...

    Checkbox 10 has changed

    Action:
    Change the value of [Last checkbox change date] to the current date /time

    The only flaw in this is that it presumed your checkboxes advance to completion, as unchecking a box will also trigger the form rule.

    But in typing this, I didn�t text bu5 it may also allow the rule

    When checkbox 1 has changed to checked. (As opposed to simply changed)