I have a Custom Object 'A' with a Look-up to another Object 'B'. Users Interact primarily with object A.

I would like to use List Views as a method simplifying the standard SFDC related list concept (customer Requirement)

I would like to override the new button and by way of VF present the user with prompt...

"It looks like you were most recently viewing Object B would you like auto populate this new Object A Record"

I know I can override the New button with a VF Page but...

Can I, based on a lookup on the record, in a sense query the most recent record(s) viewed of that object, push that into the VF, and then automatically populate the lookup on confirmation.

1 Answer 1


Hi Justin as I understood from your question is that you want to display the most recent accessed records in the lookup dialog.

This is surely possible by overriding the standard lookup dialog with the custom VF page. On the custom VF page u should query the data from the object 'Recently viewed'. This is the new metadata object that is added in Summer 13 release Make sure to use V28.0 API to use this metadata object. This returns you the last accessed records as a list.

You can traverse through these list of records and filter out the data for the object B as this list will contain the field 'type' which indicates the datatype of the record.

From this u will get the most recent accessed records of object B and u can display the same in the VF page.

Hope this approach helps you out.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .