If it were me, I would have a System Value that represents the Max Allowable Gap… SystemSetting.maxAllowedEmploymentHistoryGap…
Let’s Assume that is 120 days.
If the user enters any History records with Gap of more than 120 Days, then we need to force them to provide some explanation for the Gap. So we create addition EmploymentHistory with the DateStart and DateFinish representing the Gap and also a GapExplanation Attribute. Would be helpful to have a EmploymentHistoryType Attribute that we set to ‘GAP’ so we do not mess up our Gap Search… See Below
So, to implement…. do not check as the User enters each record of Employment History. Wait until the have enter all of their History and then check them….
Create a Non Persistent BO called NP_EmploymentHistoryGapCheck with two Attributes….
NP_EmploymentHistoryGapCheck.ps_Candidate
NP_EmploymentHistoryGapCheck.Counter
NP_EmploymentHistoryGapCheck.ps_EmploymentHistory
PROCESS:
EmploymentHistoryGapCheck1
CREATE NP_EmploymentHistoryGapCheck
CREATE NP_EmploymentHistoryGapCheck WITH NP_EmploymentHistoryGapCheck.Counter = 1
FIND EmploymentHistory
FIND EmploymentHistory WHERE EmploymentHistory.ob_Candidate = ThisCandidate AND EmploymentHistory.EmploymentHistoryType <> 'GAP' ORDER BY
EmploymentHistory.DateStart ASC IN BATCHES OF 1
SEARCH COUNT EmploymentHistory <> 0
If SEARCH_COUNT <> 0 Then
EmploymentHistoryGapCheck2 /*To Sub Process*/
SUB PROCESS:
EmploymentHistoryGapCheck2 INPUT NP_EmploymentHistoryGapCheck, EmploymentHistory
/* We check > 1 first because if we check = 1 first... the > 1 test will also execute... which we do not want */
If NP_EmploymentHistoryGapCheck.Counter > 1 AND DAY_DIFFERENCE( NP_EmploymentHistoryGapCheck.ps_EmploymentHistory.DateStart, EmploymentHistory.DateStart) > SystemSetting.maxAllowedEmploymentHistoryGap Then
CREATE EmploymentHistory WITH
EmploymentHistory.ob_Candidate = NP_EmploymentHistoryGapCheck.ps_Candidate,
EmploymentHistory.DateStart = DATE_ADD(NP_EmploymentHistoryGapCheck.ps_EmploymentHistory.DateFinish, 1),
EmploymentHistory.DateFinish = DATE_ADD(ThisEmploymentHistory.DateStart, -1)
EmploymentHistory.EmploymentHistoryType = 'GAP'
NP_EmploymentHistoryGapCheck.ps_EmploymentHistory = ThisEmploymentHistory
INCREASE NP_EmploymentHistoryGapCheck.Counter BY 1
If NP_EmploymentHistoryGapCheck.Counter = 1 AND NP_EmploymentHistoryGapCheck.ps_EmploymentHistory
IS UNDEFINED Then
NP_EmploymentHistoryGapCheck.ps_EmploymentHistory = EmploymentHistory
INCREASE NP_EmploymentHistoryGapCheck.Counter BY 1
Once this finishes then you have records in the Candidates Employment History which account for all Gaps > 120 days. You can then display that
and force then to enter an explanation for each.
Have not tried this but think it is ok…. But you get the idea.
Let me know if any issues….