saralee Posted August 9, 2010 Posted August 9, 2010 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!
saralee Posted August 9, 2010 Author Posted August 9, 2010 I mean getting the data of the field comment_date..
comment Posted August 9, 2010 Posted August 9, 2010 Getting it where? There is a difference between displaying a value, using it in a calculation, etc.
saralee Posted August 9, 2010 Author Posted August 9, 2010 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.
comment Posted August 9, 2010 Posted August 9, 2010 Try = Get (CurrentDate) - Max ( comments::comment_date ) Set the result type to Number and storage to "Do not store...".
Recommended Posts
This topic is 5219 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now