Thursday, October 29, 2015

Quick Tips: Un-clutter Report type list (hide report types)

Frankly, this is a pretty nifty feature I have just observed (never paid attention) and I thought that most of you like me, would have never looked into it. So, hereby sharing it.

While implementing Salesforce, one of the key things we showcase to users is the ease with which users can create their own reports with point-and-click features. This is definitely a very important feature for end users as they get the power to create reports in minutes without having to wait for lengthy IT process.

Vanilla Salesforce provides lots of report types out of the box as per below screenshot.
Default report type list

However, it is quite common that client might not be using certain features of Salesforce and hence those report types are not being used at all. They just clutter the report type list unnecessarily.

Salesforce provides a quick way to hide unwanted report types. Just, check the checkbox above "Select Report Types to Hide" and you can hide/ unhide report types. For e.g. we want to hide all Contracts and Products related report types

Hide unhide report types
Voilla!! you have removed one more point of confusion for your users
Uncluttered report types

Wednesday, October 21, 2015

Quick Tips: Consider this before moving to Lightning experience

With Dreamforce '15, everyone got ample view of Lightning framework and its benefits or rather "WOW" aspects. I'm equally excited to see a paramount change in Salesforce UX layer which is was much needed.

With all the excitement and eagerness to understand and use Lightning we need to also understand the process to transition from Classic UI (current UI) to Lightning Experience, or it can be a rather painful and unsatisfactory experience.

Firstly, we need to understand that it's a complete overhaul of User Experience and not mere CSS change. So, the way users interact with application or developers develop the application or architect designs the applications, changes significantly.

Secondly, as of now Lightning Experience is not fully enabled for entire Salesforce and is to be done in phases which makes complete sense. You cannot expect users to learn new system overnight and hence a transition is much appreciated. Not to mention, this also gives users/ developers opportunity to share their feedback and reviews to Salesforce, to help Salesforce improve Lightning Experience even further. So, till the time transition to Lightning experience is completed, be ready to switch between Classic UI and Lightning Experience.

Thirdly, with and Visualforce, lots of organizations and developers have done really fantastic job in creating custom user interface within Salesforce. This however can be a challenge (depends on case to case basis), for organization to move from Classic UI to Lightning experience. In fact, at this point, it is advisable for all those organizations to continue using Visualforce and not transition to Lightning, unless they are creating a completely new module.

I've hereby compiled a small list of quick tips that need to be considered (subject to change in future releases):-

  1. Custom Javascript and URL buttons are not available - so in case you need any functionality you'll have to rely on workflows, process builder, triggers etc. to initate the logic based on some fields
  2. Auto-populating standard forms via url (querystring parameters) is not available
  3. Any visualforce pages developed previousbly which uses Salesforce CSS tags or heavily rely on javascript will need thorough testing
  4. Inline editing is not supported (may be supported in future releases)
  5. Custom tabs cannot be added to new left hand navigation bar (may be supported in future releases)
  6. Lightning Experience cannot be enabled for Orgs using Person accounts
  7. Visualforce pages using standard UI tags get rendered as Salesforce classic

Tuesday, July 14, 2015

Quick Tips : Salesforce : 10 ways to develop application without coding

Hi all, as evident from the topic, I'm hereby sharing a small list of configuration options available within Salesforce using which a non-programmer can also develop functionalities within salesforce. The best part of using these features is that you save time, save development/ testing effort, deploy and manage it easily.

Standard/ Custom Objects
Objects a.k.a. table (for database junkies) a.k.a. entity are used to store data within Salesforce. We can use out of the box objects for e.g. Account, Contact, opportunity, lead etc. (along with their powerful features) or create our own custom objects to store required information for e.g. invoice, purchase orders etc.

Custom fields
As with any entity, you need to store its attribute, similarly in salesforce an object can have fields. Out of the box objects have standard fields. Additionally, custom fields can be added to standard and custom fields. Following are few special types of fields that can be added to enrich product's functionality
  1. Formula fields:- these are automated fields which can calculate value at run-time and display it. For e.g. you want to calculate age of contact dynamically via his/her date of birth
  2. Relationship fields:- these are one of the most important types of fields. Relationship fields, as name implies, help you associate an object with other object. This further helps in screen designing, validations, automated workflows
Validation rules
Formula based rules to ensure that any data being entered within salesforce conforms to business rules. Validation rules can be very beneficial in ensuring that data within Salesforce is valid at all times and provides appropriate error messages to users when data doesn't conform to business rules.

Page layouts

Page layouts are the user interface of objects within Salesforce. Whether you want to add/ update/ view an entity you can customize its user interface by a simple yet powerful drag-drop interface.

A app is a collection of tabs (of custom objects, visualforce pages, other external urls) which are logically connected for business operations. In case of service cloud, we can configure apps for service cloud console and manage all settings from here for e.g. what options to display (knowledge management, live agent chat etc.), how to open tabs etc.

Listviews can be simply explained as filtered lists of your records, to make sure you are looking at right data for e.g. My Accounts, Hot Leads, Top accounts etc. this helps in filtering view to show essential records only. Listviews can be created fairly easily and shared with other users.

Workflows and Approvals
Now, with all the above options, you can create objects, fields to store data and manage its user interface. But, what if you want to automate certain functions. This is where workflow and approvals help.

Workflows can help define specific actions for e.g. send email, update a field, create task or send message to external system whenever any record is updated/ created. Workflows can also be used to schedule an action for e.g. send an email after 5 days of case creation.

Approval processes help define a process wherein a request can be send to one or multiple reviewers for their approval. There can be multiple approval steps and actions (for e.g. send email, update a field, create task).

Lightning process builder
Process builder is comparatively new bullet in gun. It has advanced features to define process, rules and actions. It can also have a multi-step decision graph (something not possible in workflows). It can be understood as an advanced workflow mechanism.

At times, standard screens do not help when situation calls for a multiple screen scenario. In this case you can use Flows to create custom screens with ability to do CRUD operations (Create Read Update Delete) fairly easily.

Reports and Dashboards
Lastly, with all the functionalities in place, any business will want to report on their data. Salesforce provides standard reporting capabilities using which users can create reports and dashboards in minutes by mere drag and drop. It may not be as powerful as BI tool, but it is really effective and useful for transactional data. 

There are lot of cool things that can be done with combination of above options and create really powerful applications. So, start exploring all the different options available within above features to understand real power of configuration in Salesforce.

Wednesday, July 1, 2015

Quick Tips: Custom security settings (When to use Salesforce Custom Permissions?)

How often did each one of us get into a situation where we have to create custom security rules? For e.g.
  • Call center agents should not be able to give credits. Only Supervisors or Finance team can give credits
  • Only Finance and Account Manager can generate invoice.
And the most trivial way to achieve it is something like

if(profileName == 'Supervisor || profileName == 'Finance'){
     //business logic to give credits
    //throw error message

Now, one of the best ways to handle this is by using "Custom Permissions". It allows you to leverage Salesforce security infrastructure and loosely bind that to your custom logic. This helps in making your code scalable and robust. You'll learn that below.

What are Custom Permissions?
Custom Permissions was made GA in Summer '15 (ver 34.0). It is a unique way of creating a custom permission which is required/ to be used by your custom logic. For e.g. in above example, if we create a custom permission "Can give Credits" then we have ability to provide this permission to user via profile/ permission set.

Apex code needs to be modified as (Helper class implementation shared later) :-
    //business logic to give credits
    //throw error message

Now, the above code is flexible as it doesn't have hard-coded reference to the profile and hence, if in future there are new profile which need same ability to give credits, it can be achieved by simply giving custom permission to the new profiles.

How to use Custom Permissions?
  • In Formulas (easy):- In validation rules it can be simple used by using global variable "$Permission". For e.g.
  • In Visualforce (easy) - 
<apex:commandbutton action="{!save}"
value="Create Credit"> </apex:commandbutton>
  • In Apex (bit tricky as of now) - This is a little tricky wherein data is to be extracted from multiple entities (refer below entity diagram) to evaluate user's access to custom permissions.
Custom Permission - entity diagram

So, in order to retrieve custom permissions via Apex, following queries can be used:-

  1. Query to retrieve all custom permissions and where ever that permission is assigned (profile / permission set)
    Select c.Id, c.DeveloperName, (Select ParentId From SetupEntityAccessItems) From CustomPermission c
  2. Retrieve all permission sets/ profiles assigned to current user (loop through all permissions to determine permission assigned to current user)
    Select SetupEntityId From SetupEntityAccess Where SetupEntityId in :mapCustomPermissions.keySet() AND ParentId in (Select PermissionSetId From PermissionSetAssignment Where AssigneeId = :UserInfo.getUserId())

Popular Posts