Salesforce – How to show different error messages in Apex / Visualforce?

When we build custom Visualforce page, there are times we want to send some error message to user saying that something went wrong or additional data is required. Other time we want just inform him, that process bas been successfully ended.

We can do this by showing different types Apex page message severities. To do this, just use one of the following:

Salesforce – How to retrieve list of Chatter Files related to a record?

Files associated with a record can be stored in 2 ways: as an attachment (in the Notes & Attachments related list) as well as Salesforce Content (using Chatter Files).

Recently I had a task to create Visualforce pages, which put on the Page Layout as inline Visualforce showed the files posted by Chatter Files associated with the record. Adding files was carried out by the Chatter. Assigning Topics to an entry in Chatter allowed to filter files by this as a category.