Need Help Displaying Last Updated Comments Below Textbox Field

0
Hello Mendix Community, I'm facing a challenge in my Mendix project and would appreciate some guidance on how to overcome it. I have a textbox field on one of my pages where users can input comments. What I want to achieve is to display the last updated comment below this textbox field. Essentially, I want to show the most recent comment right beneath the input area. I've tried a few approaches, including using Data Views, List Views, and Template Grids, but I haven't been able to achieve the desired result. I'm unsure of the best way to retrieve and display the last updated comment dynamically. Could someone please provide me with some guidance or a step-by-step approach on how to accomplish this in Mendix? Any help, tips, or examples would be greatly appreciated. Thank you in advance for your assistance! Best regards, Asad Aslam
asked
2 answers
0

Hi Asad, 

Yes, you are on the right path to achieve it. 

small correction needs to be done to your retrieve action, you have to sort the list using updatedatetime attribute not with your comment attribute. 

To achieve the above requirement make sure you have followed these steps 

1. Hope you have created an entity to capture comments correctly, in your case that is a risk management entity. 

2. Create a datetime attribute called Lastcommentedon in the riskmanagement entity

3. When you capture the comments from user, update the Lastcommentedon attribute value while saving the comments value. 

4. In your listview use Lastcommentedon attribute in the sorting section to get the latest comments on the top right below the text field

answered
0

You select the last comment by retrieving First instead of All entities in the action and you have to sort descending on an attribute that will indicate the sequential entry of comments. You could use the standard createdDate from the entity (click the box in the entity definition in the domain model).

answered