Differnce between fromDate and toDate in CPI
In this blog, you understand the difference between fromDate and toDate and how it’s worked.
OData API supports two keywords as a filter parameter.
Use the filter parameter fromDate to return historic as well as future dated records.
fromDate gets the data basis on endDate and toDate gets the data basis on StartDate.
For example- the employee has 2 home address records in SuccessFactors, 1st address valid till 31/08/2022, and the second address valid from 01/09/2022 to 31/12/9999.
when we get the data using fromDate=9999-12-31, then the 2nd address shows.
Because fromDate always gets the data basis on endDate.
And when we get the data using toDate=9999-12-31, then both address shows.
Because toDate always gets the data basis on StartDate.
For example, 1 employee is hired on 01/05/2022 and the employee startDate is 22/7/2022. this employee endDate on 29/07/2022 set the data. If we need terminated reason and employee terminated information (end date information), we have to use fromDate=9999-12-31.
Because fromDate search the data basis on endDate.
if we use the toDate parameter not get any termination details because employee startDate>currentDate and toDate search the data basis of StartDate.
we also use this filter parameter for historical data.
for example, we have to get job changes information SF to middleware. 2010 to the current date and get all changes information then we use fromDate=2010-01-01 and toDate=currentDate
- if we need the last job change information then we have to use fromDate=currentDate
Here you saw the basic difference between fromDate and toDate.Basically, using fromDate we can get the latest data, and fromDate searches the data basis on endDate. where toDate search the data basis on startDate.
Please let me know, if you have any questions regarding this blog by commenting or if you want to give any feedback on this post.
If my post helped you anyway then please don’t forget to like the post and also press the follow button for more updates.