Expression rules

 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 error

Expression 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

Parents
  • 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
    )

Reply
  • 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
    )

Children