Forum Discussion

RobinCC's avatar
RobinCC
Qrew Cadet
6 years ago

URL button to update a Date/Time field always shows the time as 12:00 AM

I have a URL button that when pressed takes the value in Time/Date Field #1 and inserts the value into Time/Date Field #2, however, the time portion of Field #2 always shows as 12:00 AM and not the time that shows in Field #1.  For example, if the value in Field #1 is:  03-22-2019 6:18 PM, and I press the button, the resulting value in Field #2 will be:  03-22-2019 12:00 AM.   It does this every time.  Is it simply not possible to transfer the correct Date/Time in this manner or am I doing something wrong?  For the record, the button is located in the parent table called Tasks and the child table where the record is being modified is in the Logs table.  Below is my URL formula:

URLRoot() & "db/" & [_DBID_LOGS] & "?a=API_EditRecord"& "&rid="& [Max Record ID# Current User]& "&_fid_7=" & [Max Date Modified Current User] & "&rdr=" & URLEncode(URLRoot() & "db/" & [_DBID_TASKS] & "?a=q&qid=20"


Thanks

3 Replies

  • Try URL encoding the date time field

    URLRoot() & "db/" & [_DBID_LOGS] & "?a=API_EditRecord"& "&rid="& [Max Record ID# Current User]
    & "&_fid_7=" & URLEncode([Max Date Modified Current User] )
    & "&rdr=" & URLEncode(URLRoot() & "db/" & [_DBID_TASKS] & "?a=q&qid=20
  • Thanks that worked.  On a side note, and just for my general understanding, why did this work?  Why was it necessary to URLEncode the Date/Time field? 
  • Well, it was an educated guess but here is my explanation ... When you are building a URL formula field, you are, in fact creating a URL, just like you might see on any website like Amazon which can have crazy long URLs.  You will notice that website URls in general (not just Quick Base) do not have spaces in them nor do they have certain special characters.  So,  when you are building a URL string by formula you need to ensure that there are no spaces or special characters.  The URLEncode() function does that for you.

    It was a guess that the space in between the date and the time was confusing the website (ie confusing Quick Base)