How to select internal manager only?

Hi,

I have to configure a template that allows me to select just an internal manager when I'm creating an user through One Identity Manager, so an user's manager cannot be external. This is the template I wrote but it still allows me to insert an external manager.

If ($IdentityType$ = "Admin") AndAlso ($UID_Pe?rsonMasterIdentity$ <> "") AndAlso (Not($FK(UID_PersonMasterIdentity).FK(UID_PersonHead).IsExternal:Bool$)) Then
Value = $FK(UID_PersonMasterIdentity).FK(UID_PersonHead).UID_Person$
End If

What am I doing wrong?

Thank you,
Elena