I am trying to add a filter on the lookup owner based on the account field, but the filter is not working. Does anyone have an idea why?
Thanks!
handlers: /**SCHEMA_HANDLERS*/[
{
request: "crt.LoadDataRequest",
handler: async (request, next) => {
// filter the contact lookup for the account
if(request.dataSourceName !== "LookupAttribute_85sj3qr_List_DS") {
return await next?.handle(request);
}
// get the account
const account = await request.$context.Parameter_q8l08xk;
if (account) {
const filter = new sdk.FilterGroup();
await filter.addSchemaColumnFilterWithParameter(sdk.ComparisonType.Equal, "Account", account.value);
const newFilter = Object.assign({}, filter);
newFilter.items = filter.items;
request.parameters.push({
type: "filter",
value: newFilter
});
}
return await next?.handle(request);
}
}
]/**SCHEMA_HANDLERS*/,
Like
First, enable debug mode by executing the following in the browser console:
See https://customerfx.com/article/debugging-client-side-code-in-creatio-fo…
Once enabled, open the code for the page and set some breakpoints. Is a dataSourceName for "LookupAttribute_85sj3qr_List_DS" getting triggered? Maybe the name is wrong?
Is request.$context.Parameter_q8l08xk correctly retrieving the account?
Ryan