The Last function will return a value from the specified field of the last related record.
Sorting the portal records--either as a portal setup option or in the underlying relationship can be used to make the most recently created portal record the first record in the portal and the data that will be returned if, from the context of the layout's table occurrence, you refer to fields from the portal's table (such as by putting fields from the portal's table directly on the layout without any portal.)
Thank you for the quick reply, I have been trying to learn how to apply the Last function but so far no luck. Could you provide more details on how to apply this solution.
It's pretty simple. Did you look it up in FileMaker Help?
I really have no more details to provide, but you might. A detailed description of the tables/relationships involved and how you attempted to use this function might shed light on why it has not worked for you.