I am trying to create an Attestation Policy for PersonHasEset, where the first approval comes from the manager of the Person. It looks like the CM Approval procedure won't fulfill the needs of that workflow, so I have copied it and made a change to the SQL:
select hho.UID_PersonHead as UID_Person
, dbo.QER_FGIPWORulerOrigin(hho.XObjectKey) as UID_PWORulerOrigin
from AttestationCase ac
join PersonHasEset pee on pee.XObjectKey = ac.ObjectKeyBase
join Person pe on pee.UID_Person = pe.UID_Person
join HelperHeadPerson hho on hho.UID_Person = pe.UID_Person
and hho.XOrigin > 0
where ac.UID_AttestationCase = @UID_AttestationCase
union
select hho.UID_PersonHead as UID_Person
, dbo.QER_FGIPWORulerOrigin(hho.XObjectKey) as UID_PWORulerOrigin
from AttestationCase ac
join PersonHasEset pee on pee.XObjectKey = ac.ObjectKeyBase
join PersonInBaseTree /*PersonInOrg*/ pe on pee.UID_Person = pe.UID_Person
join Person p on pe.UID_Person = p.UID_Person
join HelperHeadPerson hho on p.UID_Person = hho.UID_Person
and hho.XOrigin > 0
where ac.UID_AttestationCase = @UID_AttestationCase
Now when I am trying to deny the System Role assignment in IT Shop, I get this error message:
Error during execution of statement: update AttestationCase set DateHead = '2021-05-27 14:31:31.990', DecisionLevel = 1, DisplayPersonHead = N'Paul Love', UID_PersonHead = 'd2632be2-2960-4e64-8709-0dc856828808', xdateupdated = GetUTCDate(), xuserupdated = N'JUST-EAT-DEV\d.paul.love' where (AttestationCase.UID_AttestationCase = '5e00022a-0d78-49ad-a7c8-99bfe094ebc4') and (isnull(AttestationCase.DateHead, '1899-12-30 00:00:00.000') = '1899-12-30 00:00:00.000') and (AttestationCase.DecisionLevel = 0) and (isnull(AttestationCase.DisplayPersonHead, N'') = N'') and (isnull(AttestationCase.UID_PersonHead, '') = '')
Database error 50000: re-throw in Procedure ATT_PAttestationHelperFill, Line 125
Database error 50000: detected in (SRV=AWS-MIM-DEV-03, DB=OneIM) Procedure GEN_T108BA2E4DE93DD613CD49280F, Line 73
Database error 50000: Trigger referential integrity for AttestationHelper(Insert)
50000 0 detected in (SRV=AWS-MIM-DEV-03, DB=OneIM) Procedure GEN_T108BA2E4DE93DD613CD49280F, Line 43
Database error 50000: Cannot insert object in AttestationHelper because the associated object in Person does not exist. Rule ATT_RFRL2008
(2021-05-27 15:31:32)
Can anyone suggest what is the error here please and how to resolve it?