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 Mike Schmitt

    That's exactly right, Mike.  If you include the parentheses, you also have to use partial evaluation to show the code where the array of items are supposed to be input as parameters one at a time.

    apply(

    rule!myRule,

    local!myList

    )

    does the same thing as

    apply(

    rule!myRule(_),

    local!myList

    )

    You need the underscore, otherwise you make it look like you're applying a rule with no parameters to a list, which doesn't make any sense.

Children
No Data