August 9, 201015 yr Hi, I'm writing a script to retrieve the record in a portal with the most recent date with it. I have sorted the portal in the layout with the correct order, but just don't know how to retrieve this related record.. I have a household table which relates to a comment table. So in the household layout, I have a portal to contain all the related comments, and they are sorted with most recent first. Now how can I retrieve the date of that most recent comment? Do I need to sort the records in the portal? If yes, how? Please advice. Thank you!
August 9, 201015 yr Getting it where? There is a difference between displaying a value, using it in a calculation, etc.
August 9, 201015 yr Author ok i got it.. sorry for not being clear. I'm defining a field "Days since last contact" to contain the date of the most recent contact which is the date of the most recent comment in the comments portal in the household layout. I was thinking about having the "Days since last contact" as a calc field but didn't know how to do the calc.
August 9, 201015 yr Try = Get (CurrentDate) - Max ( comments::comment_date ) Set the result type to Number and storage to "Do not store...".
Create an account or sign in to comment