Forum Discussion

JeffMickelsen's avatar
JeffMickelsen
Qrew Cadet
8 years ago

How can I add a button to load the current date-time to a field

I need to add a button to my form that will load the current timestamp into a field on my form. I think I understand how to use the Dynamic Form Rules to load the value in the finely, but I can't figure out how add the button. In searching for how to add buttons, everything seems to be several years old and does not match the current GUI. Any help would be greatly appreciated!

19 Replies

  • This is corrected code

    var text URLONE = URLRoot() & "db/" & Dbid()
    & "?act=API_EditRecord&rid=" & [RecordID#]
    & "&_fid_155=" & URLEncode("Hello");

    The middle line in your code had an underscore.
  • Great.  Now that I got that to work. 

    I figure that need to define a var which is the concat of the Today() and the current text value of hte field of interest, and then edit the record to set to field to that value.
  • Right, like

    var EventAndType = ToText(Today()) & " some other Text�;

    Or maybe

    var EventAndType = ToText(Today()) & " � & [Event Type Field];
  • I'm using the latter form.  
    Last question:  I need a carriage return after ToText(Today()).  What is the coding for that?
    • ROBERTSACHS's avatar
      ROBERTSACHS
      Qrew Cadet
      actually, I didn't. I thought I could use "%0D%0A" but that does not work.
    • QuickBaseCoachD's avatar
      QuickBaseCoachD
      Qrew Captain
      The Carriage Return character is backslash n

      So

      "\n"

      This will go to edit mode,

      var text URLTWO = URLRoot() & "db/" & Dbid()
      & "?a=er&rid=" & ToText([RecordID#]);