Salesforce – How can I get the code coverage of a class / org?

To get code coverage of a class or all classes you can use Tooling API on objects like:

  • ApexCodeCoverage – contains coverage per class per test class
  • ApexCodeCoverageAggregate – contains coverage per class for all test classes
  • ApexOrgWideCoverage – contains coverage overall for all classes in the org

The best way is run queries using Developer Console

Salesforce – Audit Trail Parser

When I was preparing my first change set, I was a bit surprised that I couldn’t get information about what was changed recently. Then I learned that there is Audit Trail which stores this kind of information as a changelog.

So I prepared a tool where you can upload a CSV file (from View Audit Trail section) and it will show you the changes made in the system (changed Apex classes, VF pages, objects, fields, profiles etc.).

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: