title: Using EXISTS and GetProfileAttrAsList in a Siebel calculated field
body: <p>In our Siebel 7.8 application, we have three entities: service requests (SR), groups and employees. Each employee can be member of one or many groups, and each service request can be assigned to one or many groups too.</p>
  
  <p>I have a requeriment to create a calculated field on the service request BC, which will indicate if the current user belongs to any of the groups asociated with the service request.</p>
  
  <p>I already have created a multivalue field, called <code>SR Groups</code>, on the service request BC. I have also another multivalue field, <code>Employee Groups</code>; this one is on the <code>Personalization Profile</code> business component, which means that Siebel will generate automatically a multivalued profile attribute with the same name. All of the above is working as expected.</p>
  
  <p>Next I've created this calculated field:</p>
  
  <pre><code>IIf(InList([SR Groups], GetProfileAttrAsList("Employee Groups")), "Y", "N")
  </code></pre>
  
  <p>It works, but it only checks if the SR's primary group is one of the current user's groups. I need to check all the SR groups, not only the primary one. So, I have created another calculated field:</p>
  
  <pre><code>IIf(EXISTS([SR Groups] = GetProfileAttrAsList("Employee Groups")), "Y", "N")
  </code></pre>
  
  <p>This one doesn't work. It shows always "N". However, according to <a href="http://docs.oracle.com/cd/B31104_02/books/PersAdm/PersAdmUserProf19.html#wp1004507" rel="nofollow">this Bookshelf document</a>:</p>
  
  <blockquote>
    <p>a typical usage of the EXISTS operator in this scenario is <code>EXISTS ([Targeted States] = GetProfileAttrAsList("State"))</code>. This does a many-to-many match of the MVG Business Component Field Targeted State against the MVG profile attribute State.</p>
  </blockquote>
  
  <p>Which is exactly what I'm trying to do, without success. I can't see any difference between my expression and the example one. And there isn't any of the typical Bookshelf warnings, like <em>"if you're going to use this function, you must activate the Link Specification property of the MVF"</em>, or anything like that.</p>
  
  <p>The business component is based on a specialized class, CSSBCServiceRequest, but <strike>I don't think that should be a problem in this case</strike> - switching it to CSSBCBase doesn't fix the issue either. The only thing not working seems to be the <code>EXISTS</code> operator, which is pretty standard in Siebel.</p>
  
  <p>Also, if I execute a query on the application with the expression <code>EXISTS([SR Groups] = GetProfileAttrAsList("Employee Groups"))</code>, it doesn't filter out any service request as it should.</p>
  
  <p>Any clues?</p>