SOLVED

To identify the last updated entry in the custom object

Go to solution
vishal_das
Level 1

To identify the last updated entry in the custom object

Hi Team,

Good day ! Is there a possibility to create a field which updates "last updated entry" with a Boolean value "True/False"

 

For example, if there is a field with current entry value and I require to know when was the last update entry made with a True/False Boolean value. Would we able to retrieve that information internally through a flag?

Regards,

Vishal

1 ACCEPTED SOLUTION

Accepted Solutions
Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: To identify the last updated entry in the custom object

Your question isn't clear, but you don't need a custom boolean field to identify whether the CO record was last updated or not as you can get that info from the updatedAt timestamp itself. Just sort the custom object records based on the updatedAt datetime field in descending order, and the record at the 0th index would be the one that was most recently updated.

#set( $sortedList = $sorter.sort($customObjList,"updatedAt:desc") )  
The most recently updated is ${sortedList[0]}

Let us know if this is helpful or if you were looking for something else.

 

View solution in original post

1 REPLY 1
Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: To identify the last updated entry in the custom object

Your question isn't clear, but you don't need a custom boolean field to identify whether the CO record was last updated or not as you can get that info from the updatedAt timestamp itself. Just sort the custom object records based on the updatedAt datetime field in descending order, and the record at the 0th index would be the one that was most recently updated.

#set( $sortedList = $sorter.sort($customObjList,"updatedAt:desc") )  
The most recently updated is ${sortedList[0]}

Let us know if this is helpful or if you were looking for something else.