If you have questions or if you want to share your opinion about Aware IM post your message on this forum
#52205 by kklosson
Sat Nov 30, 2019 11:21 pm
I am pretty knowledgeable about using protect rule as I have a multi-tenant application and use them all over the place.
After about 5 hours of work and a thorough search of the board, I am stumped. I have an attribute called HideFrom that captures the full name of an investigator (one or more). The length is 250. If the LoggedIn investigator's full name is found in the attribute, I want to READ PRORECT the object.

Here is my basic syntax that should work but does not. The result is that all objects are read-protected.
IF Candidate.HideFrom CONTAINS LoggedInInvestigator.FullName THEN READ PROTECT Candidate from Investigator.

Here is something that works as expected, but is obviously is not what I want as an outcome:
IF Candidate.HideFrom IS DEFINED THEN READ PROTECT Candidate from Investigator.

Other tests also work fine such as:
IF Candidate.LastName='Smith' THEN READ PROTECT Candidate from Investigator.

I tried something literal:
IF Candidate.HideFrom CONTAINS 'Bill' ==> This would resolve as TRUE
But again, no records we visible.

Conclusion:
Using the HideFrom attribute in conjunction with CONTAINS results in all records being read-protected.
Using the HideFrom attribute in conjunction with IS DEFINED or IS UNDEFINED produced expected results.
Can't use CONTAINS in a protect rule?
#52217 by Jaymer
Mon Dec 02, 2019 12:07 am
Try using INDEX_OF to search for the Investigators Name.
#52220 by aware_support
Mon Dec 02, 2019 3:16 am
When the value is undefined CONTAINS doesn't work properly. So your rule should look like this:

IF Candidate.HideFrom IS DEFINED AND Candidate.HideFrom CONTAINS LoggedInInvestigator.FullName THEN READ PROTECT Candidate from Investigator

Who is online

Users browsing this forum: Majestic-12 [Bot], PointsWell, swiftinitpvtltd and 11 guests