retreive most recent value in relationship calculation
I want to write a calculation that retrieves the most recent version of a relationship field.
I can see options for retrieving Sum of, Average of , Minimum of and Maximum of but how to get the latest (most recent) value?
Thanks Mike
-
I found the way to do this by browsing the other questions and answers - many thanks to Rainer.
I want to retrieve the most recent value of a related set of items.
The calculation command @All of Linked Item Field[0] returns the first or oldest related data item
and the .length function returns the number (count) of data items. In my case @All of linked itemfield.length returns 4 - there are four data items - but they are numbered 0,1,2,3 so I need to retreive item 3.
The javascript code that does this looks like this
var a = @all of FieldNameInAppB
a[a.length-1]
Please sign in to leave a comment.
Comments
4 comments