Monday 19 September 2016

Thursday 4 August 2016

Unmanaged package & GitHub repo to get LEX Opportunity progress bar inside Salesforce Classic



With reference to my previous post "Replicate Lightning Experience Opportunity Progress Bar into Salesforce Classic UI" since people are asking for easy way to replicate this, I am going to provide an unmanaged package to help people get this beautiful view at a click away.
Step #1
XperienceProgressBarForSalesforceClassic
Version 1.3

Use this URL to install the package into any organization:
https://login.salesforce.com/packaging/installPackage.apexp?p0=04t90000000NOPH 
Note: If you are installing into a sandbox organization you must replace the initial portion of the URL withhttp://test.salesforce.com
Step #2
Click Install button.

Some post-installation steps are identified below to help you get going.
Step #3
After installation, edit your Opportunity page layout to add a one column Section with '.'(a dot) as its name just above detail section as shown in screen shot below.

Step #4
Drag and drop this VF page "Slds_OpportunityProgressBar_Page" inside the added section.

Step #5
Set the VF properties(width= 100%; height=80) by clicking on wrench icon as shown in image below.

Step #6

Save your page layout to get the view as shown in this image.
Quite simple. Isn't it?   :)
Note: This is designed exclusively for Opportunity stage field. However it can be tweaked to get it working for other objects as well.
Get to the source code repository @GitHub         http://bit.ly/2aTa3pl 

Wednesday 27 July 2016

Active Workflow Rules limit exceeded? - Process Builder is the savior

I am back with this blog on my initial analysis on “Active Workflow Rules limit exceeded” workaround. They(vis-à-vis the relevant important points) are enumerated below.

We have two options. They are:

Either follow #1* below; increase the limit to 300. Further new Workflow Rules/Actions to be accomplished through Process Builder highlighted in #2** below.
OR
Identify which existing WF rules could be migrated to Process builder considering  #2** below.

·         #1* By default, each object (or entity) is limited to 50 Active Workflow Rules. If you need more, you can request an increase of up to 300 Active Workflow Rules.

·         #2** Post Salesforce Summer ’16 Release Notes, Process Builder  can execute multiple action groups at one time, giving you more ways to automate your business and manage everything in one place.



o   Meaning?

Now you can choose what happens after your process executes a specific action group. Should the process stop, or should it continue evaluating the next criteria in the process?
It’s up to you! Best of all, executing multiple action groups in a single process makes it easy to manage all of your processes for a given object, like a Case, in one place.

With this release, I think Salesforce is trying to encourage "One Process Builder Per Object" which is analogous to “One Trigger per Object” design pattern.

·         Some important limits:

o   Total number of criteria nodes in a process  - 200

o   Total number of criteria nodes that are evaluated and actions that are executed at runtime - 2,000

·         Process Builder Design Considerations

o   If you create processes to replace other setup entities, such as a workflow rule, or an Apex trigger, make sure you delete those entities when you activate the equivalent processes.
Otherwise, both workflow and processes will fire and cause unexpected results, such as overwritten records or redundant email messages.

o   Actions are executed in the order in which they appear in the Process Builder.

o   If any of the actions fail, the entire transaction fails and an error message displays.

·         Process Builder Scheduled Actions Considerations

o   If an action group contains scheduled actions, you can't continue evaluating the next criteria in your process after executing those actions.

o   2 ways as per my perspective:

§  First, create separate process builder for Scheduled Actions, OR
§  Second, keep the scheduled action in the last node of the same process builder so that there is no question of evaluating next criteria node.

·         What more I did

o   In my sandbox, I tried to validate if Process Builder has functions available to satisfy the existing Workflow rule criteria because there are certain limitations on usage of few functions in process builder.

·         Next Step

o   Identify which WF rules need to be migrated.
o   To start creating a TEST Process Builder to see how does it behave(to find any unexpected behavior) and how we can accommodate/migrate most of the existing Workflow Rules into it.


Note: These are just a analysis report prepared w.r.t. SFDC Summer '16 release notes.  Efforts have been made to simplify the concept. 

Monday 13 June 2016

Summer '16 key takeaway #4: Grant Access Based on Activated User Sessions

Grant Access Based on Activated User Sessions

Use case:  Create a permission set to allow updates to the object only when the a mobile app activates the user’s session.

User Permissions Needed
To add or remove activation records for session-based permission sets:“Manage Session Permission Set Activation”
To use the Salesforce API:“API Enabled”






Note:  To activate a session-based permission set, get your coding skills on and check out the SessionPermSetActivation object in New Objects to learn more.

Summer '16 key takeaway #3: Remove a Picklist Field Value from Records

Remove a Picklist Field Value from Records

                         

Summer '16 key takeway #2: Track Where Global Picklists Are Used More Easily

Summer '16 Key takeaway #1: Processes Can Execute Actions on More Than One Criteria



             
             EARLIER
             



            POST SUMMER '16
          
              



Click on the hyperlink to know more. Should you need to have any discussion on the topic, please contact me.   

Thursday 10 March 2016

Replicate Lightning Experience Opportunity Progress Bar into Salesforce Classic UI

In Salesforce Experience, we have seen a beautiful progress bar on Opportunity displaying different stages of sales path wherein current stage, completed stages and uncompleted stages in different colors.
How about we could display the same in Salesforce Classic?  Amazing, Right!
I had a similar requirement in one of my projects and I implemented it using Salesforce Lightning Design System (SLDS) and referring to one of the Bob Buzzard blog for one of my steps.
Don't forget to upload SLDS as static resource from https://www.lightningdesignsystem.com/resources/downloads/ 
Below are some screenshots showing the final progress bar view in Classic UI.








Note: The progress bar is non-editable at this moment. It can be further customized to make it editable.


Apex Class

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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
public with sharing class ProgressBarVisualforce_cls
{
    //Attributes for parsing picklist values
    public List<String> pickListVals {get; set;}  //list to hold picklist values on a given record type
    public String valsText {get; set;}
    public Boolean loadOnce {get; set;}
    private Opportunity opp;
   
    //attributes for segregating picklist values
    public String sCurrentStageValue {get; set;}
    public list<String> listCompletedStages {get; set;}
    public list<String> listNotCompletedStages {get; set;}
   
    public map<Integer, String> mapStageNr2StageValue ;
    public map<String, Integer> mapStageValue2StageNr ;
    public Integer sCurrentStageNr ;
   
    public ProgressBarVisualforce_cls(ApexPages.StandardController std){
        sCurrentStageValue = '' ;
        sCurrentStageNr = 0 ;
        mapStageNr2StageValue = new map<Integer, String>() ;
        mapStageValue2StageNr = new map<String, Integer>() ;
        listCompletedStages = new list<String>() ;
        listNotCompletedStages = new list<String>() ;

        String sOpportunityId = ApexPages.currentPage().getParameters().get('Id') ;
        system.debug('Sudhir sOpportunityId:: ' + sOpportunityId) ;
       
        Opportunity oOpportunity = [SELECT Id, Name, toLabel(StageName) FROM Opportunity where Id =: sOpportunityId] ;
        //toLabel is used because Translation Workbench is enabled in my org.
        sCurrentStageValue = oOpportunity.StageName ;
        system.debug('opp.StageName:: ' + opp.StageName) ;
      
        loadOnce=true;
        //reload();
    }

    public void reload(){
        pickListVals=new List<String>();
        Boolean skip=true;
        for (String val : valsText.split(':')){
            if (skip){
                skip=false;
            }else {
                pickListVals.add(val);
            }
        }
        loadOnce=false;
        //
       
        for(Integer i = 0; i < pickListVals.size(); i++){
            mapStageNr2StageValue.put(i+1, pickListVals[i]) ;
            mapStageValue2StageNr.put(pickListVals[i], i+1) ;
        }
        system.debug('Sudhir mapStageNr2StageValue:: ' + mapStageNr2StageValue) ;
        system.debug('Sudhir mapStageValue2StageNr:: ' + mapStageValue2StageNr) ;
       
        if(mapStageValue2StageNr.containsKey(sCurrentStageValue)){
       
            sCurrentStageNr = mapStageValue2StageNr.get(sCurrentStageValue) ;
            system.debug('Sudhir sCurrentStageNr:: ' + sCurrentStageNr) ;
           
            for(Integer i : mapStageNr2StageValue.keySet()){
                if(i < sCurrentStageNr){
                    listCompletedStages.add(mapStageNr2StageValue.get(i)) ;
                } else if(i > sCurrentStageNr){
                    listNotCompletedStages.add(mapStageNr2StageValue.get(i)) ;
                }
            }
           
            system.debug('Sudhir listCompletedStages:: ' + listCompletedStages) ;
            system.debug('Sudhir listNotCompletedStages:: ' + listNotCompletedStages) ;
        }
    }


}

Visualforce page




Please note that this is my first step to implement this. However it may further customized/optimized.

Tuesday 23 February 2016

Force.com Spring '15 Release: Set Up Test Data for an Entire Test Class

This is an important update from Salesforce in Spring 2015 release.
Rather than re-phrasing the same theory again, I am just sharing an article explaining this awesome annotation @testSetup to be used for Test Classes.
The below link has everything needed to know as a part of this feature.



Friday 15 January 2016

Simplifying Salesforce.com Security Model pictorially

This blog is a small step to amalgamating the different aspects of Salesforce Security Model by displaying how Record Access is defined in an org. This security model is an important area to understand while building a Salesforce application.

**Please note that these info are consolidated from various Salesforce webinars so that some important concepts can be tracked at a single place in a lucid manner. This could be primarily helpful for the beginners to have a 360 degree view of security settings.



                        












                 


             

               


     

               

In Short or At a Glance, you can refer the below two images.

     

So, referring the image below, the approach should firstly look at the foundation which is Object CRUD(controlled by Profiles) and then move upwards following horizontally through OWD, Role Hierarchy, Sharing Rules, Manual Sharing, Apex Sharing.



Please note that these info are consolidated from various SFDC webinars so that the important concepts can be tracked at a single place.

Happy Salesforce.com Evangelism..