Attribute - Filter, Removable filter, Filter Expression
Typically it would be relevant for the below types:
for which Lookup filtering section is configurable.
Show on the select list only the records of the class which is picked on another select type attribute (dependable filtering). Deployed as Filter.
On purchase cost allocation line, user selects first type of item (in fact appoints the class in select 'Type Of Line'):
-d15fb9e163a21bad24996b9d388eb7ed.png)
'Item' attribute of lookup select type, is showing up only the objects of the class picked in 'Type of Line' .
'Type Of Line' attribute is represented by the key typeOfLine . It appoints to the class object type:
-503bdafb4f2e9b3c162b205b1253ea19.png)
and has limited possibility to choose from (by above filter definition):
-e32694f082c8dbee80854ccb1f9de813.png)
Item is select type attribute. It has deployed the following setup with Filter:
-a94f7a625094c6de95786f954a76a3b9.png)
As the parameter to the applied filter is used the id of the class appointed in 'Type Of Line' . In this manner we can achieve 'dependable filtering', in where selection in second lookup 'Item' is determined by the prior selection in 'Type Of Line'. Please notice that the 'Lookup to Object Class' property of the 'Item' attribute is not chosen because it is deliverd within the filter.
Show on the list of values to pick, only my documents - as Filter property for Select type
Can also be deployed for other filter types and other control types, including Lookup & filtering section.
nominatedId.id==[Me]
In the example above, Select type attribute (placed on the form, assigned to the class of 'Custom object type') is orientated for custom object type 'Personal Corporate Award', and class 'Personal Corporate Award'. On the form assigned to this class, there is attribute with the key nominatedId which is of Select type, appointing to person and providing the information with which person the nomination document is related. We are setting up it's Filter property of the attribute of document of 'Custom object type', in away to be able to pick only the nominations related with 'my user'. Please notice that the Filter operates on the keys of attributes on destination form of objects whihc user is picking.
-53fed3eadaf630552c74a78d338ae6ef.png)
-00ab5b6135a7e57f31fe15c339de83d9.png)
Show on the list ID&Certificates Types which are marked as Active - as Filter property for Multi-select type
In the described example, the form assigned to the class: 'ID&Certificates Type' is extended with the Bolean type attribute: Active, key=activeCert.
Filter expression:
activeCert==true
On the list will be available only these types which are marked as Active.
Show on the select list only the departments which match their code by 6 first characters of the code assigned to the object which is chosen on another lookup - as Filter Expression to Select type.
On the cost allocation line for the purchase invoice, after choosing 'Object', system filters the departments list in 'Department.' lookup by matching 6 first characters of the code from object to the code of the department:
-d837de7ad851f1788832feb2b8f6e060.png)
'Object' attribute is deployed like the Select type to Object (Center):
-6bdacea3d33606ca510a1e2aadc6f3fb.png)
On the Object (Center) form, under name key is stored Object code:
-94d04f36ae0d33584883c416d75fa87a.png)
The 'Department.' attribute is deployed like select type to departments:
-926af0bf4db0e09a613e9d75a0a79086.png)
It has defined 'Filter expression' in the following way:
const code='${objectId.name}';
const codeInDepartment = '$lookup{code}';
const code6 = code.substring(0, 6);
return code6 === codeInDepartment;
For the code constant is assigned code (under name key) from assigned in object 'Object' attribute.
codeInDepartment constant - takes the value of the code key from current row in department, from departments list
code6 constant takes 6 first characters from code constant (from 1st line)
In the case code6 matches with codeInDepartment then the true is returned and the department with matching code is displayed. Otherwise it is returned false and the department with not matching code is not displayed.
This is the example of the implementation of dependable filtering with matching different than by the same picked in object
Show on the multiselect list for classes only the ones assigned in setup
The task is to achieve the scenario that there should be shorten, predefined in setup, list of the classes available for appointing in multiselect attribute 'Document Types' attribute on folder object (DMS functionality).
-9d92d98b6a8d1ad6903fcf7d6c9bc811.png)
On the same folder's object from, there is assigned, in select attribute, workflow performance scheme which is treated like the setup entry:
-69d2e62696ed65ed27bc48d2e5a5e8ee.png)
In this 'setup record' there are assigned the available classes:
-c29960b8e06d1a535e4afb0b585b48d8.png)
In the Filter Expression of 'Document Types' attribute we have:
-ac71a609bbb39c085a6cc967ecd942d3.png)
const classIdInClasses = '$lookup{id}';
const idsFromSetup = ${workflowPerformenaceScheme.documentClassessInFolders};
for (const idd of idsFromSetup) {
if (idd.id === classIdInClasses) {
return true;
}
}
Constant classIdInClasses takes the value of the currently checked class id from the classes full list.
Constant idsFromSetup takes the value as the collection of the classes assigned to default workflow performance scheme record, in 'Default classes included into folders'.
In 'for' loop system iterates per each class in the collection from idsFromSetup . If the value of currently checked class (from classIdInClasses ) matches the id of the current class from collection (idd.id) then system returns true and such class is available on the multiselect list:
-83654389126600f18e074894ec9ed4b9.png)