Not able to terminate resources with back date
Symptoms
Not able to terminate resources with back date
Error:
"Resource" cannot be unassigned on "date" due to an existing unassignment or transfer on "date". Please specify another date.
Reason
The system prevents resource termination since there are records in workgroupHistoryMember
with MemberType = ''act'' after the termination date that client wants to set
Resolution
If the following query returns date, then resource cannot be terminated before that date.
select top 1 dbo.F_Droptime(effectiveDate) as effectiveDate
from workgroupHistoryMember WITH (nolock) where resourceid =[@ResourceIDTobeterminated]
and Updated=0x1 and
WorkgroupHistoryMemberType in('trf','act')
and dbo.F_Droptime(EffectiveDate) ">" dbo.F_Droptime([@UnassignDateToBeSet])
order by effectivedate desc