Working with the Employee Clock In & Clock Out App, but keep getting errors when I click the Clock In/Out buttons. I need assistance.

  • 0
  • 1
  • Question
  • Updated 4 years ago
  • Answered

I'm trying to create simple clock in/out app and figured I would just customize this one.  The issue I'm having is when I click the button (code below) I get the error listed at the bottom.  Please assist:


Code for button:

If(IsNull([Morning Punch Time]),

URLRoot() & "db/" & Dbid() & 

"?a=API_EditRecord&rid="& [Record ID#]

& "&_fid_7=" & 

URLEncode (Now())

&"&rdr=" & URLEncode(URLRoot()& "db/" 

& [_DBID_TIME_CARDS] & "?a=dr&rid=" & [Record ID#]),

"javascript:alert('This has already logged in.')")


ERROR THAT I KEEP GETTING:

<qdbapi> <action>API_EditRecord</action> <errcode>24</errcode> <errtext>Invalid Application Token</errtext> <errdetail>An Application Token must be supplied.</errdetail> </qdbapi>
Photo of Jason

Jason

  • 30 Points

Posted 4 years ago

  • 0
  • 1
The easiest solution is to turn off the need for Application Tokens. This is set in Application Settings.
Photo of Keith

Keith, Champion

  • 1,204 Points 1k badge 2x thumb
add an apptoken parameter to the edit api call - see below in bold

If(IsNull([Morning Punch Time]),

URLRoot() & "db/" & Dbid() & 

"?a=API_EditRecord&rid="& [Record ID#]

& "&_fid_7=" & URLEncode (Now())

& "&apptoken=paste-your-app-token-here"

&"&rdr=" & URLEncode(URLRoot()& "db/" 

& [_DBID_TIME_CARDS] & "?a=dr&rid=" & [Record ID#]),

"javascript:alert('This has already logged in.')")