Sunday 10 April 2016

#Salesforce Certified Platform Developer II : Sharing Experience

Hi All,
After long time of 5 months I went for another certification and this one is a new one, didn't get allot of information about the experience of the this new salesforce certification, now I have 8 salesforce certs, I must say this one is made me nervous, but felt great when I cleared this one.

Here are few important things that should be looked into before appearing in the exam

Compound Field Considerations and Limitations

Address and geolocation compound fields are convenient and result in more concise, clear code. Here are some things to consider when using them in your apps.
Both address and geolocation compound fields have the following limitations.
  • Compound fields are read-only. To update field values, modify the individual field components.
  • Compound fields are accessible only through the SOAP and REST APIs. The compound versions of fields aren’t accessible anywhere in the Salesforce user interface.
  • Although compound fields can be queried with the Location and Address Apex classes, they’re editable only as components of the actual field. Read and set geolocation field components by appending “__latitude__s” or “__longitude__s” to the field name, instead of the usual “__c.”
Use convertCurrency() in a SOQL query to convert currency fields to the user’s currency. This action requires that the organization is multicurrency-enabled.
Use this syntax for the RETURNING clause:
For example,
FIND {test} RETURNING Opportunity(Name, convertCurrency(Amount))

If an org has enabled advanced currency management, dated exchange rates are used when converting currency fields on opportunities, opportunity line items, and opportunity history. With advanced currency management, convertCurrencyuses the conversion rate that corresponds to a given field (for example, CloseDate on opportunities). When advanced currency management isn’t enabled, the most recent conversion date entered is used.

Continuation :Make Long-Running Callouts from a Visualforce Page

Use asynchronous callouts to make long-running requests from a Visualforce page to an external Web service and process responses in callback methods. Asynchronous callouts that are made from a Visualforce page don’t count toward theApex limit of 10 synchronous requests that last longer than five seconds. As a result, you can make more long-running callouts and you can integrate your Visualforce pages with complex back-end assets.

An asynchronous callout is a callout that is made from a Visualforce page for which the response is returned through a callback method. An asynchronous callout is also referred to as a continuation.

Transaction Control

All requests are delimited by the trigger, class method, Web Service, Visualforce page or anonymous block that executes the Apex code. If the entire request completes successfully, all changes are committed to the database. For example, suppose a Visualforce page called an Apex controller, which in turn called an additional Apex class. Only when all theApex code has finished running and the Visualforce page has finished running, are the changes committed to the database. If the request does not complete successfully, all database changes are rolled back.
Sometimes during the processing of records, your business rules require that partial work (already executed DML statements) be “rolled back” so that the processing can continue in another direction. Apex gives you the ability to generate a savepoint, that is, a point in the request that specifies the state of the database at that time. Any DML statement that occurs after the savepoint can be discarded, and the database can be restored to the same condition it was in at the time you generated the savepoint.

DML Statements vs. Database Class Methods

Apex offers two ways to perform DML operations: using DML statements or Database class methods. This provides flexibility in how you perform data operations. DML statements are more straightforward to use and result in exceptions that you can handle in your code. 

Set Up Test Data for a Test Class

Test setup methods are defined in a test class, take no arguments, and return no value. The following is the syntax of a test setup method.
@testSetup static void methodName() {
Use test setup methods (methods that are annotated with @testSetup) to create test records once and then access them in any test method in the test class. Test setup methods are useful and can be time-saving when you need to create a common set of records that all test methods operate on or prerequisite data.

Best Practices for Improving Visualforce Performance

Defining Transient with variable and minimizing the view state, using lazy loading and  the minification of JavaScript and CSS,

InvocableMethod Annotation

Use the InvocableMethod annotation to identify methods that can be run as invocable actions.
Invocable methods are called with the REST API and used to invoke a single Apex method. Invocable methods have dynamic input and output values and support describe calls.
The following code sample shows an invocable method with primitive data types.

 public class AccountQueryAction {  
  @InvocableMethod(label='Get Account Names' description='Returns the list of account names corresponding to the specified account IDs.')  
  public static List<String> getAccountNames(List<ID> ids) {  
   List<String> accountNames = new List<String>();  
   List<Account> accounts = [SELECT Name FROM Account WHERE Id in :ids];  
   for (Account account : accounts) {  
   return accountNames;  

Pagination Strategies 

When to use standardsetcontroller, or when to offset and SOQL, best that you can have about this topic is this post

Few more topics

1. Lightning components
2. Using Developer console.
3. Test class best practice
4. SOQL and SOSL
5. Apex charts
6. Rollup summary
7. Http callout and its testing

If you cover all these topics, then for sure you can clear this exam.