In my Lookup it must show only those contacts who have Specific role.
Example:
Contact-1 , Contact-2 are present
Contact-1 Have Role-1 and contact-2 will have Role-2
Lookup must show only Contacts with Role-1 .
If not possible Can we have workaround for this .
In my Example it will show all contacts who are system users.
for these i want to filter collection based on role.
I tried this Please let me know the changes needed.
"lookupListConfig": {
// Array of filters used for the query that forms the lookup field data.
"filters": [
function() {
var filterGroup = Ext.create("Terrasoft.FilterGroup");
// Adding the "IsUser" filter to the resulting filters collection.
// The filter provides for the selection of all records in the Contact core schema
// to which the Id column from the SysAdminUnit schema is connected, for which
// Id is not equal to null.
filterGroup.add("IsUser",
Terrasoft.createColumnIsNotNullFilter("[SysAdminUnit:Contact].Id"));
// Adding the "IsActive" filter to the resultant filters collection.
// The filter provides for the selection of all records from the core schema.
// Contact to which the Id column from the SysAdminUnit schema, for which
// Active=true, is connected.
filterGroup.add("IsActive",
Terrasoft.createColumnFilterWithParameter(
Terrasoft.ComparisonType.EQUAL,
"[SysAdminUnit:Contact].Active",
true));
return filterGroup;
}
]
}
}
Like
Dear Sushma,
In order to check whether a contact has particular role you need to create a query to the SysAdminUnitInRole table. Basically setting up the filter to check whether current user has the needed role in SysAdminUnitInRole table.
Please modify your filter settings to read from correct table. Also, please see the article below, which describes how to create queries to the database. (particularly Definition of root schema. Creation of paths to columns against root schema. Examples.)
https://academy.bpmonline.com/documents/technic-sdk/7-13/use-entitysche…
Regards,
Anastasia