Errors in expression rule when multiple matches from the database.

Hi All,

I am getting the error if multiple matches exist for the filter criteria. Below given is the code. Can anyone please help me out?

a!queryEntity(
entity: cons!TEMS_ENTITY_V_TE_DETAILS,
query: a!query(
paginginfo: a!pagingInfo(1, - 1),
logicalexpression: a!queryLogicalExpression(
operator: "OR",
filters: {
a!queryFilter(
field: "cafNumber",
operator: "=",
value: tostring(local!selectedCaf)
)
}
)
),
fetchTotalCount: true
).data

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    Hi shubhamy,

    1.) please try this function for inserting code.

    This makes the life of your content reader way easier.

    2.) What is the error telling you, can you insert as well?
    what is the overall use case? Often its not an issue of your query and more of the usage of the query.

    3.) 

    a!queryLogicalExpression(
    operator: "OR",
    filters: {
    a!queryFilter(
    field: "cafNumber",
    operator: "=",
    value: tostring(local!selectedCaf)
    )
    }
    )

    a) why are you using "OR"?

    b) why are you using querylogialexpression and not just the "filter" parameter of your query if you are looking for just one value in your DB?

    c.) is "local!selectedCaf" multiple?

Reply
  • 0
    Certified Senior Developer

    Hi shubhamy,

    1.) please try this function for inserting code.

    This makes the life of your content reader way easier.

    2.) What is the error telling you, can you insert as well?
    what is the overall use case? Often its not an issue of your query and more of the usage of the query.

    3.) 

    a!queryLogicalExpression(
    operator: "OR",
    filters: {
    a!queryFilter(
    field: "cafNumber",
    operator: "=",
    value: tostring(local!selectedCaf)
    )
    }
    )

    a) why are you using "OR"?

    b) why are you using querylogialexpression and not just the "filter" parameter of your query if you are looking for just one value in your DB?

    c.) is "local!selectedCaf" multiple?

Children