I have created two fields. One Field have Application name and other have roles.
I wanted to get the roles assigned to the selected application in above field. But could not figure out how to get the roles assigned to an application. Then I noticed that all the roles also contain the application name.
I want to display those roles which have atlease 3 starting characters matching with selected application. How Is this approach possible?
Below is the code I was using till now. How should I filter out roles?
<Section label="Application Name" name="Section 2">
<Field displayName="Select" dynamic="true" name="Field_6" postBack="true" required="true" type="Application"/>
<Field displayName="Roles" multi="true" name="Field_7" postBack="true" required="true" type="Bundle">
<AllowedValuesDefinition>
<Script>
<Source>
import sailpoint.tools.Util;
import sailpoint.object.Bundle;
import sailpoint.object.QueryOptions;
import sailpoint.object.Filter;
List roleList= new ArrayList();
QueryOptions ops=new QueryOptions();
ops.addFilter(Filter.eq("type","SAP"));
Iterator it = context.search(Bundle.class, ops);
while ( (null != it) && (it.hasNext()) ) {
Bundle record = (Bundle)it.next();
roleList.add(record.getName()) ;
}
return roleList;
</Source>
</Script>
</AllowedValuesDefinition>
</Field>
</Section>