Hello community!
I'm creating a list in the Case object's form page to display processes logs that are connected to the current record, so that I get a detailed trace of executions for any case record. I have already created the list to display the information and it is something like this:
As you may see, for this example the list retrieves only 1 record because there was only 1 execution of the process "Modify case" that was connected to the current case. If I run another process connected to this case I will have something like this:
My problem is that the filter implemented for the list has the Schema UId and record id hardcoded, as I don't know how to retrieve than information dynamically inside the filter configuration. With those hardcoded values, the information is fetched and filtered correctly, but I can't seem to implement it in a generic way. I've tried to get the current record id with things like:
- $Id
- $PDS.Id
- PDS.Id
- ProcessLogListDS.Id
But none of them seem to work. This is the page code with the filter configuration:
define("Cases_FormPage", /**SCHEMA_DEPS*/[]/**SCHEMA_DEPS*/, function/**SCHEMA_ARGS*/()/**SCHEMA_ARGS*/ {
return {
viewConfigDiff: /**SCHEMA_VIEW_CONFIG_DIFF*/[
...
]/**SCHEMA_VIEW_CONFIG_DIFF*/,
viewModelConfigDiff: /**SCHEMA_VIEW_MODEL_CONFIG_DIFF*/[
{
"operation": "merge",
"path": [
"attributes"
],
"values": {
"ProcessLogList": {
"isCollection": true,
"modelConfig": {
"path": "ProcessLogListDS",
"filterAttributes": [
{
"loadOnChange": true,
"name": "ProcessLogList_PredefinedFilter"
}
]
},
"viewModelConfig": {
"attributes": {
"ProcessLogListDS_Name": {
"modelConfig": {
"path": "ProcessLogListDS.Name"
}
},
"ProcessLogListDS_Id": {
"modelConfig": {
"path": "ProcessLogListDS.Id"
}
}
}
}
},
"ProcessLogList_PredefinedFilter": {
"value": {
"items": {
"masterRecordFilterWrapper": {
"filterType": 6,
"isEnabled": true,
"logicalOperation": 0,
"items": {
"masterRecordFilter": {
"filterType": 6,
"isEnabled": true,
"logicalOperation": 1,
"items": {
"entityFilter": {
"filterType": 5,
"comparisonType": 15,
"isEnabled": true,
"leftExpression": {
"expressionType": 0,
"columnPath": "[VwSysProcessEntity:SysProcess].Id"
},
"subFilters": {
"filterType": 6,
"isEnabled": true,
"logicalOperation": 0,
"items": {
"EntityIdFilter": {
"filterType": 1,
"comparisonType": 3,
"isEnabled": true,
"leftExpression": {
"expressionType": 0,
"columnPath": "EntityId"
},
"rightExpression": {
"expressionType": 2,
"parameter": {
"dataValueType": 1,
"value": "47b777ca-4d1e-46f2-b2dc-22324202db2e" // This is the current Case record id for the example
}
}
},
"SchemaUidFilter": {
"filterType": 1,
"comparisonType": 3,
"isEnabled": true,
"leftExpression": {
"expressionType": 0,
"columnPath": "SysSchema.UId"
},
"rightExpression": {
"expressionType": 2,
"parameter": {
"dataValueType": 1,
"value": "117d32f9-8275-4534-8411-1c66115ce9cd" // This is the Case Schema UId
}
}
}
}
}
}
}
}
}
}
},
"logicalOperation": 0,
"isEnabled": true,
"filterType": 6,
"rootSchemaName": "VwSysProcessLog"
}
}
}
}
]/**SCHEMA_VIEW_MODEL_CONFIG_DIFF*/,
modelConfigDiff: /**SCHEMA_MODEL_CONFIG_DIFF*/[
...
]/**SCHEMA_MODEL_CONFIG_DIFF*/,
handlers: /**SCHEMA_HANDLERS*/[]/**SCHEMA_HANDLERS*/,
converters: /**SCHEMA_CONVERTERS*/{}/**SCHEMA_CONVERTERS*/,
validators: /**SCHEMA_VALIDATORS*/{}/**SCHEMA_VALIDATORS*/
};
});
What the filter basically does is equivalent to the following OData query:
https://my-site.creatio.com/0/odata/VwSysProcessEntity?$filter=EntityId…