Hi @iamksatish
modified the script template you shared.
It’s not showing accounts in field. Its coming as no result found. No matter what application I select.
Below is the code I changed
<Field displayName="Accounts" dynamic="true" multi="true" name="Field_7" postBack="true" required="true" type="string">
<AllowedValuesDefinition>
<Script>
<Source>
import sailpoint.object.QueryOptions;
import sailpoint.object.Filter;
import sailpoint.object.Link;
String applicationName = form.getField("Field_6").getValue();
QueryOptions linkQO = new QueryOptions();
linkQO.addFilter(Filter.eq("application.name", applicationName));
Iterator iter = context.search(Link.class, linkQO);
List accountNames = new ArrayList();
while (iter.hasNext()) {
Link link = (Link) iter.next();
accountNames.add(link.getNativeIdentity());
}
return accountNames;
</Source>
</Script>
</AllowedValuesDefinition>
</Field>
It is not good to use context.getObjects particularly in forms as this will cause performance issue when you have large data and infact bring down your system