I have an issue with expression rule. my rule is as follows:a!queryEntity(entity: cons!LCW_BUSINESS_UNIT_ENTITY,query: a!query(filter: if(rule!APN_isEmpty(ri!businessDivision.id),{},a!queryFilter(field: "businessDivision.id", operator: "=", value: ri!businessDivision.id)),pagingInfo: a!pagingInfo(startIndex: 1, batchSize: -1, sort: a!sortInfo(field: "order", ascending: true))),fetchTotalCount: true)but when i execute this i get the following errorExpression evaluation error at function a!queryEntity: Cannot apply a filter with a blank field name.can someone pls help?
Discussion posts and replies are publicly visible
Hi Vinay.
I got the same error above this conversations, and I try to implement your code but It doesn't work.
I tried to filter a field from a datagrid using this similar code.
In query Filter in filed mention actual filed like
a!queryFilter( field: "businessDivision", operator: "=", value: ri!businessDivision.id) )
your filed name in cdt
a!queryEntity( entity: cons!LCW_BUSINESS_UNIT_ENTITY, query: a!query( filter: if( rule!APN_isEmpty( ri!businessDivision.id ), null, a!queryFilter( field: "businessDivision", operator: "=", value: ri!businessDivision.id ) ), pagingInfo: a!pagingInfo( startIndex: 1, batchSize: - 1, sort: a!sortInfo( field: "order", ascending: true ) ) ), fetchTotalCount: true)
I tried to made a filter with a!pickerFieldCustom component.
The value that I get from this component, I want to put it as a Filter Value for the a!queryEntity and made the filter directly to the a!gridField, but this error appear: Cannot apply a filter with a blank field name
Please supply us with some more details.
First, it would help to see the structure of the CDT for ri!businessDivison.
Second, I would like you to please run the following modified query and paste the output here:
a!queryEntity( entity: cons!LCW_BUSINESS_UNIT_ENTITY, query: a!query( pagingInfo: a!pagingInfo( startIndex: 1, batchSize: 1 ) ) )
By any chance, is it possible for you to attach the screenshot of your CDT structure and the sample response data, because i suspect on it's field name as well as it's value.
If you can share these details, will help the practitioner to identify the root cause and provide you the resolution to overcome this issue.
Rewrite the code so that you are not executing the query when value provided to filter field is empty.
Just as an FYI, it's probably not very useful to post new replies on these old "zombie" threads (those over 1 year old, or even over a few months old in most cases), as the issues are most likely long since resolved or irrelevant.