How to create an Extension Rule with other types different f

Posted by Ricardo Jorge on 19-May-2017 04:18

What I need is to create something like:

- collection -> sortedBy (attribute)

- the string -> at (elementIndex) - in this case I would like to create a method that gives first element in the list that respects some conditions -> firstWhere (attribute).

I searched but did not find anything that could help me.

If someone could provide me with the "sortedBy" and "at" functions it would be great because I think it would cover all my doubts.

Thanks,

Ricardo Jorge

Posted by Chris S. Hogan on 23-May-2017 13:25

You could write an extended operator that takes in a collection and some type of filter criteria, however you can also accomplish the same with just rules.

This example takes a list of customers, filters for those that are in the State of CA, sorts by age, and then returns the 3rd youngest.

The complete projects is here:

[View:/cfs-file/__key/communityserver-discussions-components-files/14/4300.SortedPosition.zip:320:240]

All Replies

Posted by Chris S. Hogan on 23-May-2017 13:25

You could write an extended operator that takes in a collection and some type of filter criteria, however you can also accomplish the same with just rules.

This example takes a list of customers, filters for those that are in the State of CA, sorts by age, and then returns the 3rd youngest.

The complete projects is here:

[View:/cfs-file/__key/communityserver-discussions-components-files/14/4300.SortedPosition.zip:320:240]

Posted by Ricardo Jorge on 06-Jun-2017 04:10

Ok, I can do it with the filters.

Thanks.

This thread is closed