Forum Discussion
Is there any particular reason in your first example you're using the code page at all? Is there another process that you're running or do you just need the button to log the current time and then refresh the page? If that's the case then you can just do a button like this:
URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&apptoken=APP_TOKEN"
& "&rid=" & [Record ID#] & "&_fid_62="&ToTimeOfDay(Now()) & "&rdr=" & URLEncode(URLRoot() & "db/" & Dbid() & "?a=DoRedirect&z=" & Rurl())
This will just do the editRecord and then refresh the page your on. It sounds like some of your issues relate to the state of the browser page and the page/document not reloading based on how you're currently navigating in the app, so having the button just do a simple refresh should solve for it so that the button refreshes it's own components/reloads the idea of now() for your use.
------------------------------
Chayce Duncan
------------------------------
- TimD2 years agoQrew Trainee
you can also just do URLEncode("today") so you dont have to refresh even if you've been on the page for a while, it will take the system's time... found it in this forum somewhere so credit goes to that person
------------------------------
Tim D
------------------------------- BarryDolan2 years agoQrew Cadet
humm, that just put the word "today" in the field.
I'm trying
------------------------------
Barry Dolan
------------------------------
- BarryDolan2 years agoQrew Cadet
I began using the code page because that's how it was in the Magic Buttons app, but since I've found that I didn't need that, I disable the code page.
As, as in my explanation, I tried using refresh with this: & "&rdr=" & URLEncode(URLRoot() & "db/" &Dbid() & "?a=dr&rid=" & [Record ID#])
I didn't have any success using "?a=DoRedirect&z=" & Rurl())
A hard refresh is the only thing that seems to make a difference.
------------------------------
Barry Dolan
------------------------------- MarkShnier__You2 years agoQrew Legend
Barry
I'd you were populating a date/time field in this syntax populate the field with the date/time when the page loaded.
"&_fid_99=" & Now()
However, this improved syntax below will populate field 99 with the current date and time when the button is pushed.
&_fid_99=now
If your issue is that the button is getting stale while sitting on the screen, for example, if you were designing a time, clock application, where employees punch in and out, then you want to know when the button is pushed.
So my suggestion is use that syntax to populate the date/time field and then use a different formula field to extract out just the time of day portion of that field.
------------------------------
Mark Shnier (Your Quickbase Coach)
mark.shnier@gmail.com
------------------------------