apply Function Issue

I have a gridtextColumn with a local variable to store the datasubset value obtained from a query. I am trying to build a link to a record for that column on all rows of the grid. I used apply function with a proper rule and index function along with it. But for some reason it does not work.

 a!gridTextColumn(
            label: "Id",
            field: "Id",
            data: index(local!datasubset.data, "Id", null),
            links:apply(rule!POC_getRecordLink(),
              index(local!datasubset.data, "Id", null))
          )

It gives me an error -->

Interface Definition: Expression evaluation error at function 'apply' [line 33]: A rule or function reference is expected as the 1st parameter.

Although I have put the rule as you can see? Any idea then why this error?

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Certified Lead Developer
    in reply to sanjuktab2257

    I did my own little stress test - it looks like in extreme cases (lists of 100,000 items for example), apply() is between 6x and 10x faster than a!forEach().  Probably because apply() is a primitive function and, i'd guess, uses lower-level code.  IMHO this trade-off would only matter in ridiculously extreme cases and very very rarely matter in any real-world usage, particularly compared to the complexity and readability trade-off.

Children
No Data