appendEmployeePunchByFilekey() Method

Table of Contents

  1. Function
  2. Syntax
  3. Parameters
  4. Return Value
  5. Sample Code
  6. Remarks
  7. Possible Errors
  8. Preferred Method
  9. Related Methods

Function

  • Adds a punch transaction to employee’s time card for current or previous pay period

Syntax

  • AeXMLBridge.appendEmployeePunchByFilekey(Filekey, TimeStamp, StationNum, TransactionType);

Parameters

  • Integer - employee filekey
  • String - timestamp (yyyy-MM-dd HH:mm:ss format)
  • Integer - station identifier
  • Integer - transaction type

Return Value

  • None

Sample Code

C#

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

string ts = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
// get timestamp and format appropriately

TAeBasicDataItem[] stations = ws.getStationsSimple();

int filekey = 1234;
// employee filekey
int transType = 0;
// 0 = punch

try
{
ws.appendEmployeePunchByFilekey(filekey, ts, stations[0].Num, transType);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}

VB.Net

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

Dim ts As String = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
' get timestamp and format appropriately

Dim stations As TAeBasicDataItem() = ws.getStationsSimple()
' can set to '0' for any

Dim filekey As Integer = 1234
' employee filekey

Dim transType As Integer = 0
' 0 = punch

Try
ws.appendEmployeePunchByFilekey(filekey, ts, stations(0).Num, transType)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try

Remarks

  • Punch transactions will always be applied unless a duplicate transaction exists
  • If clock station and/or Transaction Type are unknown, you can set these values to 0
  • Use getStationsSimple to retrieve a list of clock group stations if needed

Possible Errors

  • Duplicate Transaction
  • yyyy-mm-dd is required [Date supplied in invalid format]
  • No such employee with Filekey
  • Transaction timestamp outside of acceptable date range

Preferred Method

appendEmployeePunchByIDNum

appendEmployeeGeoPunchByIDNum
appendEmployeeTransferByIDNum
extractEmployeeGPSRegistrationsByIDNum
extractTimeClockStations
getStationsSimple
punchEmployeeGeoNowByIDNum
punchEmployeeNowByIDNum
registerEmployeeGPSPresenceByIDNum
transferEmployeeNowByIDNum

Back to Top