EdwardHefter
3 years agoQrew Cadet
Using printed QR codes to Clock In or Clock Out of a Task
I am setting up a timekeeping system and want to use printed QR codes to clock in and out of specific tasks (the codes would be on the bin of material being worked on).
I have a URL for clocking in and one for clocking out that works, and on the form I have the QR code that has the URL hide or show based on whether the current user is currently clocked in or out. I am trying to have a QR code that will determine which user is logged into the phone that is scanning the QR code, figure out if she is currently clocked in, and then use the appropriate URL.
Any suggestions?
Here is the URL to Clock in (using the "now" rather than "now()" in the URL is nice because I can print it on paper and it is always gives the current time):
var text redirect = "&apptoken=XXXXXXX&rdr="&URLEncode(URLRoot() & "db/" & Dbid() & "?a=doredirect&z=" & Rurl());
URLRoot() & "db/br4vigw5t/(_DBID_TIMECARDS)?a=API_AddRecord&_fid_6=" & [Record ID#]&"&_fid_8=Now&_fid_7="&URLEncode(User())&$redirect
Here is the URL to Clock out (this one is convoluted because it has to find the task that the current user is clocked in to and while structurally, they can be in multiple tasks, based on other constraints they are only able to be in one task, which is why using the SumValues function works in this case):
var text redirect = "&apptoken=XXXXXXX&rdr="&URLEncode(URLRoot() & "db/" & Dbid() & "?a=doredirect&z=" & Rurl());
var text TimecardQuery = "{6.EX."&[Record ID#]&"}AND{7.TV.'_curuser_'}AND{15.EX.0}";
var number CurrentUserTimecardID = Nz(SumValues(GetRecords($TimeCardQuery,[_DBID_TIMECARDS]),29),9999);
URLRoot() & "db/br4vigw5t/(_DBID_TIMECARDS)?a=API_EditRecord&rid="&$CurrentUserTimecardID&"&_fid_9=Now"&$redirect
------------------------------
Edward Hefter
www.Sutubra.com
------------------------------
I have a URL for clocking in and one for clocking out that works, and on the form I have the QR code that has the URL hide or show based on whether the current user is currently clocked in or out. I am trying to have a QR code that will determine which user is logged into the phone that is scanning the QR code, figure out if she is currently clocked in, and then use the appropriate URL.
Any suggestions?
Here is the URL to Clock in (using the "now" rather than "now()" in the URL is nice because I can print it on paper and it is always gives the current time):
var text redirect = "&apptoken=XXXXXXX&rdr="&URLEncode(URLRoot() & "db/" & Dbid() & "?a=doredirect&z=" & Rurl());
URLRoot() & "db/br4vigw5t/(_DBID_TIMECARDS)?a=API_AddRecord&_fid_6=" & [Record ID#]&"&_fid_8=Now&_fid_7="&URLEncode(User())&$redirect
Here is the URL to Clock out (this one is convoluted because it has to find the task that the current user is clocked in to and while structurally, they can be in multiple tasks, based on other constraints they are only able to be in one task, which is why using the SumValues function works in this case):
var text redirect = "&apptoken=XXXXXXX&rdr="&URLEncode(URLRoot() & "db/" & Dbid() & "?a=doredirect&z=" & Rurl());
var text TimecardQuery = "{6.EX."&[Record ID#]&"}AND{7.TV.'_curuser_'}AND{15.EX.0}";
var number CurrentUserTimecardID = Nz(SumValues(GetRecords($TimeCardQuery,[_DBID_TIMECARDS]),29),9999);
URLRoot() & "db/br4vigw5t/(_DBID_TIMECARDS)?a=API_EditRecord&rid="&$CurrentUserTimecardID&"&_fid_9=Now"&$redirect
------------------------------
Edward Hefter
www.Sutubra.com
------------------------------