Hi,
I have the following code to invoke a multi select window.
request.$context.executeRequest({ type: "crt.OpenLookupPageRequest", $context: request.$context, entitySchemaName: "AccountType", //filtersConfig: add any filters here features: { select: { multiple: true, selectAll: false, resultType: 'lookupValues' }, create: { enabled: false } }, });
I'm struggling with adding a filterconfig (I need a IN filter; if the value exist in a list of values).
Can you help with an example?
Thanks,
Chani
Like
To do an IN filter, you basically just use sdk.ComparisonType.Equal and the value is an array of Ids. See this thread: https://community.creatio.com/questions/im-getting-error-invalid-cast-systemstring-systemguid
Ryan
Also, crt.OpenLookupPageRequest was deprecated and replaced with crt.OpenSelectionWindowRequest. You can see how to use that and set a filter in this thread: https://community.creatio.com/questions/has-crtopenselectionwindowrequest-replaced-crtopenlookuppagerequest-813
Ryan
Ryan Farley,
Thank you.
I'm able to filter with sdk outside the OpenLookupPageRequest and filter by equals = string in the filterconfig but don't know how to combine them together.
Thanks for your help!
Ryan Farley,
Sorry, I think I wasn't clear.
I meant to say that if I use
await filter.addSchemaColumnInFilterWithParameters( sdk.ComparisonType.Equal,
it works but I can't find a way to filter with IN in the filterconfig.
See my code for a single Id which works:
AccountsFilter: { value: { items: { "b7a5f2c1-4f0a-4d5e-9a93-9c7c61e3d001": { filterType: 1, comparisonType: 3, isEnabled: true, trimDateTimeParameterToDate: false, leftExpression: { expressionType: 0, columnPath: "Id" }, isAggregative: false, rightExpression: { expressionType: 2, parameter: { dataValueType: 10, value: accountIds[0] } } } }, logicalOperation: 0, isEnabled: true, filterType: 6 } }
What can I do to apply the filter for the full accountIds list?
Thanks