Syntax of CreateExistsFilter with sub filters in server side code
Hi Community,
Any idea what is the syntax of CreateExistsFilter with sub filters in server side code. Thanks.
Like
Hello Fulgen,
Here is a post on CreateExistsFilter - https://community.creatio.com/questions/example-createexistsfiltercolumnpath.
If you are asking on what code is executed when you use such filter - this has to be debbuged.
If you are asking how to create a filter using CreateExistsFilter on server side - the answer is you cannot since 7.15. CreateExistsFilter was created for client side usage to replace Terrasoft.ComparisonType.Exists on server side.
Thank you Yevhenii
I checked the link but it is page not found.
Fulgen Ninofranco,
Hello,
You need to remove the . at the end of the link (it's also being copied into the URL bar when clicking on it). But this link will lead to examples for the client-side ESQ.
As for the server side: for example see the AddProcessRightsFilterToHintQuery method from the CommandLineService in your application:
private void AddProcessRightsFilterToHintQuery() { EntitySchemaQueryFilter rightsFilter = _hintQuery.CreateExistsFilter("[VwSysProcessSchemaUserRight:SysSchema:SysSchemaId].Id"); rightsFilter.Name = "processesRights"; EntitySchemaQuery rightsSubQuery = rightsFilter.RightExpressions[0].SubQuery; IEntitySchemaQueryFilterItem adminUnitFilter = rightsSubQuery.CreateFilterWithParameters( FilterComparisonType.Equal, "SysAdminUnit", UserConnection.CurrentUser.Id); adminUnitFilter.Name = "adminUnit"; rightsSubQuery.Filters.Add(adminUnitFilter); _hintQuery.Filters.Add(rightsFilter); }
Here the "exists" filter is created and also a sub-query inside it (which is rightsSubQuery) is used.