sukarande
(Sumit Ukarande)
2
Can you please share your form?
can you share your form XML?
i don’t see the XML here, could you add again? either inline or as an attachment
Try to print the finalList in syslogs and check syslogs when you click on dropdown whether it is giving any error?
Preethi
(Preethi J)
10
No. Its not giving any error . I am able to print the list
Preethi
(Preethi J)
11
<Field displayName="Owner" filterString="inactive == false" name="manager" required="true" type="Identity" value="ref:manager">
<AllowedValuesDefinition>
<Script>
<Source>
import java.util.List;
import java.util.ArrayList;
import sailpoint.object.Application;
import sailpoint.object.Identity;
import sailpoint.object.Link;
import sailpoint.object.QueryOptions;
import sailpoint.object.*;
import java.util.Iterator;
import java.util.Collections;
List finalList =new ArrayList();
QueryOptions qo=new QueryOptions();
Filter f1 = Filter.eq("employmentstatus", "A");
Filter f2 = Filter.or(Filter.eq("type", "employee"),Filter.eq("type", "contractor"));
qo.addFilter(Filter.and(f2,f1));
Iterator itr = context.search(Identity.class,qo);
while (itr.hasNext()) {
Identity id = (Identity) itr.next();
if (id != null) {
finalList.add(id.getName());
}
}
return finalList;
</Source>
</Script>
</AllowedValuesDefinition>
</Field>
can you try after removing value="ref:manager
You can handle the same use case with a more complete filter string
See the reworked code below
<Field displayName="Owner" name="owner" required="true" type="sailpoint.object.Identity">
<Attributes>
<Map>
<entry key="hidden">
<value>
<Script>
<Source>
import sailpoint.object.Filter;
Filter f1 = Filter.eq("inactive", false);
Filter f2 = Filter.eq("employmentstatus", "A");
Filter f3 = Filter.or(Filter.eq("type", "employee"), Filter.eq("type", "contractor"));
field.setFilterString(Filter.and(f1, f2, f3).getExpression());
return false;
</Source>
</Script>
</value>
</entry>
</Map>
</Attributes>
</Field>