Unable to use Aggregation on CDT fields with many-to-many relationship.

Certified Senior Developer

Hi,

Am unable to use aggregate functions on child CDT having many to many relationships with parent CDT.

Background

I have a parent CDT called Campaign which has many to many relationship with child CDT called Channel. I have Campaign table, Channel table and mapping table as well to hold the relationship in database.

Requirement

I need to group the Campaigns based on Channels.

Issue

I am unable to use Aggregate functions on channels field in my Parent CDT - Campaign.

How can I achieve this using CDT relationships.

Thanks

 

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    Thanks for your reply.

    We already have a mapping table between campaign and marketing channel to store the many to many relationship.

    Even filtering on channel value is not working.

    Code:

    a!localVariables(
    local!data:
    a!queryEntity(
    entity: cons!MSS_ENTITY_CAMPAIGN_REQUEST,
    query: a!query(
    logicalExpression: a!queryLogicalExpression(
    operator: "AND",
    filters: {
    a!queryFilter(
    field: "marketingChannels.value",
    operator: "in",
    value: ri!channel
    )
    },
    ignoreFiltersWithEmptyValues: true
    ),
    pagingInfo: ri!pagingInfo
    ),
    fetchTotalCount: true
    ),
    local!data
    )

    Error:  

    Expression evaluation error at function a!queryEntity [line 3]: Cannot filter by field [marketingChannels.value] because it is a complex, multiple, or child of a multiple data type.

    Thanks

Reply
  • 0
    Certified Senior Developer

    Thanks for your reply.

    We already have a mapping table between campaign and marketing channel to store the many to many relationship.

    Even filtering on channel value is not working.

    Code:

    a!localVariables(
    local!data:
    a!queryEntity(
    entity: cons!MSS_ENTITY_CAMPAIGN_REQUEST,
    query: a!query(
    logicalExpression: a!queryLogicalExpression(
    operator: "AND",
    filters: {
    a!queryFilter(
    field: "marketingChannels.value",
    operator: "in",
    value: ri!channel
    )
    },
    ignoreFiltersWithEmptyValues: true
    ),
    pagingInfo: ri!pagingInfo
    ),
    fetchTotalCount: true
    ),
    local!data
    )

    Error:  

    Expression evaluation error at function a!queryEntity [line 3]: Cannot filter by field [marketingChannels.value] because it is a complex, multiple, or child of a multiple data type.

    Thanks

Children
No Data