Getting a cast invalid error while trying to conditionally display a standard icon indicator in a paging grid

Hi,

I am trying to conditionally display a standard icon indicator in a 2 column paging grid by calling a!iconIndicator() inside a!documentImage() to display this icon in a grid image column. However, i get the following error instead:

Interface Definition: Expression evaluation error at function a!documentImage [line 45]: Could not cast from Rule or Function Reference to Document. Details: CastInvalidCould not cast from Rule or Function Reference to Document. Details: CastInvalid

Attached corresponding SAIL code that throws this error.

Any help to fix this issue is highly appreciated

OriginalPostID-231066


applicationDetailsGrid.txt

  Discussion posts and replies are publicly visible

Parents
  • I am pretty sure the problem is here:
    apply(
    a!documentImage(
    document: if(
    _,a!iconIndicator(
    "PROGRESS_RUNNING"
    ),
    a!iconIndicator(
    "PROGRESS_PAUSED"
    )
    )
    ),
    index(
    local!dataForCurrentPage,
    "isActive",
    null
    )
    )

    You can't loop over an arbitrary expression using apply(); it either needs to be a function or rule.

    Could you try putting your a!documentImage expression in a rule that takes in isActive as a parameter?
Reply
  • I am pretty sure the problem is here:
    apply(
    a!documentImage(
    document: if(
    _,a!iconIndicator(
    "PROGRESS_RUNNING"
    ),
    a!iconIndicator(
    "PROGRESS_PAUSED"
    )
    )
    ),
    index(
    local!dataForCurrentPage,
    "isActive",
    null
    )
    )

    You can't loop over an arbitrary expression using apply(); it either needs to be a function or rule.

    Could you try putting your a!documentImage expression in a rule that takes in isActive as a parameter?
Children
No Data