on 07-08-2020 3:43 PM
Hi experts,
I am having a wierd issue when using SF OData service.
When I am trying to fetch all the time sheets between a particular date range, one particular timesheet doesn't come up eventhough the criteria is correct.
/odata/v2/EmployeeTimeSheet?$select=startDate,endDate,approvalStatusNav/value,approvalStatusNav/en_US,userId,employeeTimeSheetEntry/externalTimeCode,employeeTimeSheetEntry/startDate&$expand=approvalStatusNav,employeeTimeSheetEntry&$filter=startDate ge '2020-06-16T00:00:00' and endDate le '2020-06-29T00:00:00'&$format=json
But when I run it for just that particular external code, the entry is fetched.
odata/v2/EmployeeTimeSheet('6fb29242eca7494ca4868a1c02243b93')?$format=json
Response:{
"d": {
"__metadata": {
"uri": /odata/v2/EmployeeTimeSheet('6fb29242eca7494ca4868a1c02243b93')",
"type": "SFOData.EmployeeTimeSheet"
},
"endDate": "/Date(1592784000000)/",
"startDate": "/Date(1592265600000)/"
}
}
I have a feeling its because of timezone conversion issue/etc, but the date is given as LE and GE so the end dates should also be considered, right?
The idea is to fetch Employee Time Sheets lying within a particular pay period.
Found the issue
When I am searching by endDate as say endDate le '2020-06-29T00:00:00' it is actually considering the end date as 12:00 am of 29th June and not end of day.
Solution - Changed the query to have only date and the service internally fetches all.
endDate le '2020-06-29T'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
4 | |
4 | |
3 | |
2 | |
2 | |
2 | |
2 | |
2 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.