[{TableOfContents }]

!!!P2K__CF_ECR_EXISTS
The workflow custom function called P2K_CF_ECR_EXISTS reads through the Contact Role Contact Types and returns TRUE if it finds a match to the value populated to the UserCalc global [CONTACT_TYPE] or FALSE if it does not.\\

!!Setup
In the [IMUC] screen create the Global called CONTACT_TYPE  as a type of “Char”.\\  \\
[P2K_CF_ECR_EXISTS_01.JPG]\\
 
!!Sample Work Flow UserCalc
A sample Work Flow UserCalc in its simplest form (see example in screenshot) would be to set the CONTACT_TYPE global to ‘03’ (Emergency Contact) then call the P2K_CF_ECR_EXISTS custom function.

If the triggering contact record has a contact role with “Emergency Contact” set, then the custom function will return TRUE and the system proceeds to the next line, otherwise the system jumps to the end.

In our sample, the result of getting TRUE returned has the [ECT.SECURITY_LEVEL] being set to ‘01’ which represents “Emergency”.

In a real world scenario you would add conditions to the UserCalc to check whether the security level already had a value.\\  \\
[P2K_CF_ECR_EXISTS_02.JPG] 

[{If var='loginstatus' contains 'authenticated'

----
![Discussion|Edit:Internal.P2K__CF_ECR_EXISTS] 	
[{InsertPage page='Internal.P2K__CF_ECR_EXISTS' default='Click to create a new discussion page'}] 	

}]