Pages

Friday, December 29, 2017

Tips for passing Salesforce certified Integration Architecture Designer (WI18)

Today (28th Dec'2017), I have successfully passed Salesforce certified Integration Architecture Designer (WI18)  with an overall score 93%

I have faced total 60 questions. Unlike Sharing and Visibility exam and Deployment Designer exam, there are no additional questions. It has taken around 80 hours of preparation mostly one month time frame.





Exam Objective


The Salesforce Certified Integration Architecture Designer exam has the following characteristics:
  • Content: 60 multiple-choice/multiple-select questions* (5 unscored questions will be added)
  • Time allotted to complete the exam: 90 minutes (time allows for unscored questions)
  • Passing Score: 67%
  • Registration fee: USD 400, plus applicable taxes as required per local law
  • Retake fee: USD 200, plus applicable taxes as required per local law
  • Delivery options: Proctored exam delivered onsite at a testing center or in an online proctored environment. Click here for information on scheduling an exam.
  • References: No hard-copy or online materials may be referenced during the exam.
  • Prerequisite: None

*Please note that as of November 16, 2017, all Salesforce certification exams will contain five additional, randomly placed, unscored questions to gather data on question performance. The duration of each exam has been evaluated and adjusted to accommodate the inclusion of the unscored questions. These five questions will be in addition to the 60 scored questions on your exam, and will have no impact whatsoever on your score.

Preparing myself


Before I started my preparation, I have prepared a document and noted down all the points and advice mentioned by these guys. Thanks to all of them.

Topics I have received on Exam


  • Different types of APIs (SOAP, REST, BULK, Metadata), their usage, restrictions and limitations
  • Advantages of using them over another. 
  • Lots of questions of Outbound messages and following points to be noted
    • It has guaranteed delivery and may produce duplicate records in the consumer system.
    • It can pass SessionId
    • To consume it, the end point listener must have SOAP API implementation
    • Declarative way of making outbound call
    • It doesn't allow multiple objects
    • It allows junction object
    • Callback of this message should incur API limit
  • Bulk data load (Bulk API parallel mode and Serial mode with different batch size)
  • Confusing question on SOAP API (parallel mode)
  • API limit
    • Note that SOAP API callout to external system doesn't consume API limit.
    • Bulk API has separate API limit (refer documentation)
  • Unauthenticated and Authenticated mashup. First one is for Custom web tab, second one is for Canvas
  • Different types of testing, like regression, unit, UAT, Continuous integration
  • Different kinds of design patterns and which can be used over another
  • Apex Webservice (SOAP and REST based)
  • Data replication API, SOAP based getUpdated() usage.
  • Salesforce-to-Salesforce (when should be done and not to be)
  • Different kinds of authentication mechanism (including canvas)
  • Different types of sandboxes and which one is suitable for different types of testing
  • Data loading tools (Data loader, Data Import wizard, Workbench)
  • Usage of middleware (4 to 5 questions) and ESB (Enterprise Service Bus)
  • Off-platform de-duplication and Salesforce out-of-box duplicate management (when to use what?)
  • Encryption on rest and transmit - Base64 encoding, platform encryption, encryption with shared key
  • IP white-listing and considerations on firewall.
If anyone follows above links and study material completely then definitely could clear this exam at first try. All the questions are from study materials and based on real life scenarios.

Above all, it's a great relief passing this exam.

Related Posts





Wednesday, December 20, 2017

Visualforce with JQuery Datatable for sorting, pagination and handling 10000 records

Use Case


Sometimes we get a requirement to display tabular data in visualforce which will have following features:


  • Data will be displayed in paginated way.
  • Column headers must be sortable
  • Keyword search in the list itself.
  • More over if we want to display 10000 records in the list.

Solution

We can leverage JQuery datatable library to achieve those functionalities.

Controller



 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
public with sharing class SortWrapper 
{

    public List<ContactInfoWrapper> ContactsWrapper {get; set;}    
    //added for paginnation
    public List<List<ContactInfoWrapper>> listofContactsWrapper {get; set;}
    
    public SortWrapper()
    {
  ContactsWrapper = new List<ContactInfoWrapper>();
  listofContactsWrapper = new List<List<ContactInfoWrapper>>();
        getContacts();
    } 
     
    public void getContacts()   
    {
        for(Contact s:[SELECT Id, Name, Email, Phone, Account.Name FROM Contact])
        {            
            ContactsWrapper.add(new ContactInfoWrapper(s)); 
            if(ContactsWrapper.size() == 999)
   {
    listofContactsWrapper.add(ContactsWrapper);
    ContactsWrapper= new List<ContactInfoWrapper>();
            }                
        } 
        if(ContactsWrapper.size() != 0){
   listofContactsWrapper.add(ContactsWrapper);
     }   
        
    }
    
 //Wrapper class
    public class ContactInfoWrapper
    {
        public Contact sObj{get;set;}
        public Boolean checked {get;set;}
        public ContactInfoWrapper(Contact con)
        {
            sObj = con;  
            checked=false;  
        } 
    }
}

Visualforce



 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<apex:page id="SortPage" controller="SortWrapper"  showHeader="false">
    <!--added for pagination-->
       <head>
        <apex:includescript value="//code.jquery.com/jquery-1.11.1.min.js" / >
        <apex:includescript value="//cdn.datatables.net/1.10.4/js/jquery.dataTables.min.js" />
        <apex:stylesheet value="//cdn.datatables.net/1.10.4/css/jquery.dataTables.css" />
        <script>
            j$ = jQuery.noConflict();
            j$(document).ready( function () {
                var contactTable = j$('[id$="contacttable"]').DataTable({
                    
                });
            });
        </script>
    </head>
   <!---End of Pagination--->
   
    <apex:form id="myForm">
   
        <apex:sectionHeader title="Contact"/><br/>
        
        <apex:pageBlock>
            
            <apex:pageBlockSection title="Contact Records" collapsible="false" columns="1"/>
            <br></br>
            <body>                
                <table id="contacttable" class="display">       
                    <thead>
                        <tr>
                            <th style="width:10%;">Select</th>
                            <th style="width:25%;">Name</th>
                            <th style="width:30%;">Account Name</th>                                
                        </tr>
                    </thead>
                    <tbody>
                        <apex:repeat value="{!listofContactsWrapper}" var="contactinfowrp" id="tableInd">
                              <apex:repeat value="{!contactinfowrp}" var="con">
                               <tr >
                                  <td><apex:inputCheckbox value="{!con.checked}"/></td>
                                  <td>{!con.sObj.Name}</td>
                                  <td>{!con.sObj.Account.Name}</td>
                              </tr>
                            </apex:repeat>
                        </apex:repeat>
                    </tbody>
                </table>
            </body>
        </apex:pageBlock>  
    </apex:form>
</apex:page>

Outcome


Friday, December 15, 2017

Tips for passing Salesforce certified Development Lifecycle and Deployment Designer

Today (14th Dec'2017) I have successfully passed Salesforce certified Development Lifecycle and Deployment Designer exam.

I have faced 65 questions (including 5 unscored questions) and for me it has taken total 25 hours (almost 3 and half days) to prepare for this exam and my overall score is 84%


Exam Objective


The Salesforce Certified Development Lifecycle and Deployment Designer exam has the following characteristics:
  • Content: 60 multiple-choice/multiple-select questions* (5 unscored questions will be added)
  • Time allotted to complete the exam: 90 minutes (time allows for unscored questions)
  • Passing Score: 68%
  • Registration fee: USD 400, plus applicable taxes as required per local law
  • Retake fee: USD 200, plus applicable taxes as required per local law
  • Delivery options: Proctored exam delivered onsite at a testing center or in an online proctored environment. Click here for information on scheduling an exam.
  • References: No hard-copy or online materials may be referenced during the exam.
  • Prerequisite: None

*Please note that as of November 16, 2017, all Salesforce certification exams will contain five additional, randomly placed, unscored questions to gather data on question performance. The duration of each exam has been evaluated and adjusted to accommodate the inclusion of the unscored questions. These five questions will be in addition to the 60 scored questions on your exam, and will have no impact whatsoever on your score.

Preparing myself


Before I started my preparation, I have prepared a document and noted down all the points and advice mentioned by these guys. Thanks to all of them.



Topics I have received on Exam


  • What is the advantages and disadvantages of Waterfall and Agile methodology.
  • When to use what type of sandboxes (Developer edition, partial copy, fullcopy)
  • Deployment approach for hotfixes.
  • Deployment approach for Daily, Minor, Major releases
  • Metadata API
  • Given a scenario which deployment tool is most preferable (Force.com IDE, ChangeSet, Force.com Migration tool)
  • Role & Responsibilities of CoE, Architecture Review Board, Release Manager
  • Given a scenario for mitigating risk of deployments
  • Testing best practices
  • Ant based deployment with different types of braching
  • Continuous Integration with source code control system
  • Agile accelerator and its usage.
  • Managed and unmanaged package (when to use what)
  • Conflicting situation during salesforce release and your release and how to handle the situation

Overall, this exam is relatively easy as compared to my earlier architect exams like Sharing and Data designer exams. My real life project experience has helped me passing the exam with relatively few hours of preparation.

Related Posts




Sunday, December 10, 2017

Platform Encryption - Encryption at Rest


Use Case

Recently, I got a requirement to implement Salesforce Shield (platform encryption) at our salesforce organization. It brings a question to me how Salesforce uses platform encryption and encrypt the data at Rest.

Solution

If we refer Salesforce Shield Platform Encryption Implementation Guide, we get to know how below process flow works and I am not going deep into this as going through the pdf we can understand the flow and ultimately data is derived based on master key and tenant key.


For a sake of proof of concept, I have defined Case Subject, Description and Case comment fields to be encrypted.

To do this follow: Setup -> Platform Encryption


Click on Encrypt Fields link to reach Encrypt Standard Field page and defined as follows:


Then, I have created a sample case with this subject and description:

If I try to query the same case record from the Developer Console, it returns as follows:


Now, how can I prove that data is encrypted as I can see the data as usual. Moreover there is no such proof of Encypted indicator as I can see for attachment as follows:




This makes me curious about this poc.

Approach


First I described the Case Subject field from workbench and it displays as encrypted and also thought that I am an authorized user to access this record that's why I can read the data in a normal way. But I was not satisfied with this.



To make it full proof, I archived the tenant key and exported the key as backup.


Then, destroyed the tenant key based on which that case subject and description got generated.


Now, accessed the same record, it is showing ????? (means, This service is unavailable now). This means encrypted data which has been encrypted with my previous tenant key is not available.

That sounds interesting to me.

But, how can I retrieve the previous data then?

So, I imported the same previous tenant key as follows:



After importing, accessed the same case record. It showed the data again.

Conclusion


It gives me confidence that subject and description standard fields have been encrypted properly with Salesforce shield and encrypted at Rest.


Further Reading


Platform Encryption - Things to know before activating Platform Shield

Saturday, November 4, 2017

Types of execution - System Mode or User Mode?

Overview


I was trying to prepare a consolidated list of different types of executions and if those are executed in System mode or User mode.

Taken from my popular question: Types of execution

What it actually means?


User Mode - Profile level permissions, field-level security, and sharing rules of the current user are enforced.
System Mode - Object permissions, field-level security, sharing rules aren't applied for the current user.

Comprehensive list


  • Trigger - System
  • Validation Rule - System
  • Auto Response Rule - System
  • Assignment Rule - System
  • Workflow Rule - System
  • Escalation Rule - System
  • All Types of calculation behind formula, Rollup Summary - System
  • Process Builder - System
  • Visual Workflow or flow - User
    • if flow is called from Process Builder - System
    • if flow is called from Workflow - System
    • if flow is called from Apex - (depends on with or w/o sharing of apex class)
    • if flow is called from Custom Button - System
    • if flow is embed in Visualforce - Depends on VFP context
    • if flow is called from REST API - System
  • Approval Process - System
  • Publisher Action - System
  • InvocableMethod
    • if this is called from flow - User
    • if this is called from Process Builder (does it depends on with or without sharing is specified on that Class) - System
    • if this is called from REST API - (depends on with or w/o sharing of the class)
  • Custom Button - System
  • Test method with System.runAs() - User
  • Test method without System.runAs() - System
  • Visualforce Page (StandardController) - User
  • Visualforce Page (StandardController with extension) - System
  • Visualforce Page (Custom Controller)
    • depends on with or without sharing of the controller
  • Visualforce Component - depends on Visualforce page where it is used
  • Macros - System
  • Annonymous Apex - User
  • Chatter in Apex - User
  • Email Service - User
  • All types of Jobs - System
  • Apex Webservices (SOAP API and REST API) - System (Consequently, the current user's credentials are not used, and any user who has access to these methods can use their full power, regardless of permissions, field-level security, or sharing rules.)

Monday, October 23, 2017

Tips for passing Data Architecture & Management Designer (SU'17)

Today (22nd Oct'2017), I have successfully passed Data Architecture and Management Designer (SU17) and acquired Salesforce certified Application Architect credential.

I have faced total 60 questions. Unlike Sharing and Visibility exam there are no additional questions. It has taken around 100 hours of preparation mostly one and half months time frame.






Exam Objective

The Salesforce Certified Data Architecture and Management Designer exam has the following characteristics:
  • Content: 60 multiple-choice/multiple-select questions* (2-5 unscored questions may be added)
  • Time allotted to complete the exam: 90 minutes (time allows for unscored questions)
  • Passing Score: 67%
  • Registration fee: USD 400, plus applicable taxes as required per local law
  • Retake fee: USD 200, plus applicable taxes as required per local law
  • Delivery options: Proctored exam delivered onsite at a testing center or in an online proctored environment. Click here for information on scheduling an exam.
  • References: No hard-copy or online materials may be referenced during the exam.
  • Prerequisite: None

Preparing myself

Before I started my preparation, I have prepared a document and noted down all the points and advice mentioned by these guys. Thanks to all of them.


Topics I have received on Exam


  • Strategies for data migration, data archieval
  • How to resolve timeout issues
  • Skinny table
  • PK Chunking
  • Use of Bulk API
  • Use of rollup summary
  • Different types of locking and how to overcome those
  • Master data management
  • Reports and Dashboards
  • Integration with external system
  • Validation rule, workflow rule, outbound message.
  • Indexing
  • Use of External Ids
  • Use of AppExchange product and third party ETL tool
  • Field History tracking
  • Metadata API.
  • Analytic snapshot.
By the way, Salesforce recommended training guide doesn't cover 100% areas of the exam. Around 10-15% of the questions were outside of the material which I could assume so far.



Sunday, October 8, 2017

Visualforce webservice callout synchronously & asynchronously

Overview

Recently we have received a business case to perform a webservice callout from our Custom Visualforce page.

There are following ways we can make callout from Visualforce page.
  • Asynchronously
  • Synchrounously

Approach: Asynchronous callout (@future method)


From visualforce page, first we will verify all standard and business validations and then perform callout and any error message during save will be displayed on the UI.

For example if Customer Name is blank if will show the error message in the UI and will not perform callout.

Visualforce

From commandbutton action, save method will get called.

<apex:page id="MyVisualforcePage" controller="MyController"  showHeader="false">
    <apex:pageMessages id="msgId"/>   
    <apex:form id="MyForm">
        <apex:inputText id="customerNm" value="{!CustomerName}"/><br/>
        <apex:commandButton value="Save" action="{!save}" reRender="msgId"/>
    </apex:form>
</apex:page>

Controller

In the save method, it will verify if customer name is blank and show the error in UI, otherwise call performRestCallout().


public class MyController
{
 public String CustomerName {get;set;}
 
 public PageReference save()
 { 
  if(String.isBlank(CustomerName))
  {
   ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.Error, 'Name cannot be null');
   ApexPages.addMessage(msg);
   return null;
  }
  else
  {
   //perpare JSON and then callout
   MyWebService.performRESTCallout(JSONString);
  }
  //navigate to view page
  PageReference pg =  (new ApexPages.StandardController (new CustomObject__c(Id=recordId))).view();
  pg.setRedirect(true);
  return pg;
 }
}

WebService Class

public class MyWebService
{
    @future(callout = true)
    public static void performRESTCallout(string JSONString)
    {
 //perform callout
    }
}

If any error messages from callout occurs that can be handled following ways:

(Taken from bob_buzzard's answer)

(1) Post a chatter message to the user
(2) Send an email to the user
(3) Create a custom object/setting, add the message to that and write a visualforce page for the sidebar that displays the message.


Approach: Synchronous callout (using commandbutton oncomplete method)


Salesforce doesn't allow to commit data and perform callout in a single transaction as it will throw error message "Uncommited task is pending".

The following approach works well.

From commandbutton's action, we will call save method, it will commit the data and then oncomplete method with the help of javascript and actionFunction we will perform second action and hence perform callout. So, there will be two different transactions and no more errors.

That looks good!!!

Now, what will happen if during save, UI validation and business validations to be performed and if any error occurs that needs to be shown on UI and will not perform oncomplete call.

Secondly, since it is synchronous call, so any exceptions or errors returned from webservice call must be displayed on the UI.

Here is the most tricky part (where I have spend hours to find the work around, finally Eric from StackExchange helped me retaining the error message in UI. My question & Eric's answer).

Visualforce

Here conditionally oncomplete needs to be called.


  • So hasError property has been defined on controller. 
  • Access hasError values in the outputPanel which is getting rendered from commandbutton reRender attribute
  • Using oncomplete javascript function, first verify if error exists (hasMessages == 'false') and then call submit action with the help of actionFunction.

Error will be displayed like this:



Thats nice!!!

<apex:page id="MyVisualforcePage" controller="myExampleController"  showHeader="false">
    <apex:pageMessages id="msgId"/>
    <script>
        function performCallOutMethod()
        {
            if(hasMessages == 'false') {
                performCallOut();
            }
        }
    </script>
    <apex:form id="myForm">
        <apex:actionFunction name="performCallOut" action="{!submit}" reRender="script-block,msgId"/>
        <apex:inputText id="customerNm" value="{!CustomerName}"/><br/>
        <apex:commandButton value="Save" action="{!save}"
                            oncomplete="return performCallOutMethod();" reRender="script-block,msgId"/>
    </apex:form>
 <!-- this is main trick -->
    <apex:outPutPanel layout="block" id="script-block">
        <script>
            var hasMessages = '{!hasError}';
        </script>
    </apex:outPutPanel>
</apex:page>

Controller

Save method will perform validations and then will commit the changes into database. If Customer name is blank then it will show error message.


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
public class MyController
{
 public String CustomerName {get;set;}
 
 public Boolean hasError { 
  get { 
   return ApexPages.hasMessages(); 
  }  
 }
 
 public PageReference save()
 { 
         if(String.isBlank(CustomerName))
  {
          ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.Error, 'Name cannot be null');
   ApexPages.addMessage(msg);
   return null;
  }
                //commit all data here, not giving full code for simplicity.
                insert customObj;
  return null;
 }
 
 public PageReference submit()
 {
  try
  { 
   //prepare JSON string and perform callout
   MyWebService.performRESTCallout(JSONString);
   
   //navigate to view page
   PageReference pg =  (new ApexPages.StandardController (new CustomObject__c(Id=recordId))).view();
   pg.setRedirect(true);
   return pg;
  }
  catch (Exception ex)
  {
   System.debug('Error in submit ' + ex);
                        ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.Error, ex.getMessage());
                        ApexPages.addMessage(msg);
                        return null;
  }
 }
}

WebService Class

Just a simple method and if any error occurs it will be propagated to calling method and finally be displayed at UI.


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
public class MyWebService
{
 public static void performRESTCallout(string JSONString)
        {
  try
  {
   MyWebService.performRESTCallout(JSONString);
  }
  catch(Exception ex)
  {
   throw new CustomException(ex.getMessage());
  }
 }
}

Conclusion



Which approach to be taken for implementation it will be based on business scenarios, data volumes, performance and that is a separate topic all together.

Here, I have tried to put my proof of concepts and approach to perform callouts from Visualforce and necessary error handling.

Hope it helps!

Tuesday, July 25, 2017

Tips for passing Salesforce Certified Sharing and Visibility Designer




Today (24th July'2017) I have successfully passed after around 100 hours of studying which have taken around 4 weeks though I didn't get a chance to prepare everyday.

So, before preparing the exam, I have registered the exam and then started preparing exam.

Exam Outline

Content: 60 multiple-choice/multiple-select questions*

  • Time allotted to complete the exam: 120 minutes
  • Passing Score: 68%
  • Registration fee: USD 400; Retake fee: USD 200
  • Delivery options: Proctored exam delivered onsite at a testing center or in an online proctored environment. Click here for information in scheduling an exam.
  • References: No hard-copy or online materials may be referenced during the exam.
  • Prerequisite: None



I have faced 65 questions, some of the them are very descriptive and I was running out of time. Even if few questions I have marked for review to revisit, but didn't get time of review. But finally I am happy to see me passed.


Preparing myself


Before I started my preparation, I have prepared a document and noted down all the points mentioned by these guys which helped me focusing on certain areas.




And if anyone follows those blogs and prepare the way they have mentioned then anybody can pass this exam and I am really thankful to those guys.

I have also prepared an excel on Group Membership operation and sharing recalculation for my understanding and revision.






The worksheet can be downloaded from here : Notes on Designing Record Access

Topics I have received on Exam

  • Difference between profile and permission set
  • Use of System.runAs()
  • Login Hours and Login IP changes
  • How to restrict or grant access to the records by using Role Hierarchy, Public Groups, Team, Territory, Partners.
  • Default sharing model for Internal and External users
  • Given a code snippet to identify the security threat
  • When to use territory management
  • Encryption in rest and transit
  • Use of Protected Custom metadata types, Protected Custom settings, Crypto class
  • Locking related issues and how to overcome that.
  • Use of Salesforce Shield
  • Apex managed sharing and reason and when to use what.
  • Sharing Set
  • Manual sharing and what happens if ownership is changed.
  • Use of FLS, Recordtype, page layout, permission set and custom permissions
  • How reports and dashboards and files can be shared.
  • Listview

Read thoroughly following study materials: 


If you have a firm understanding then you can surely pass the exam.

Related Posts


Note: I have not used any dumps and didn't prepare those, so please don't ask me for dumps.