How to provide Roll-up Summary features to a lookup relationship

Mahesh Gaikwad

A Lookup Roll-up tool provides a roll-up summary feature to a lookup relationship. It also allow's you to specify various roll-up criteria (like list) which are not supported by a standard roll-up summary.

  1. What is Lookup Rollup?
  2. What Problem statement are we trying to address.
  3. How to use Lookup Rollup?
Read More
Topics: salesforce.com, Managed Services, Learning, How To

Two ways to locate Markers on Google Maps

Luckey Kumar Sahu

Google Maps for those who don't know is a mapping service developed by Google. It offers satellite imagery, street maps, 360-degree panoramic views of streets, real-time traffic conditions, and route planning when traveling.
In this situation I am using google maps API to show buildings on google maps as per their locations. A Marker is used to plot buildings on google maps. But, when two or more markers are very close to each only then a single marker is displayed on google maps which makes it difficult to identify the number of available markers at the same point. To address this problem, there are two techniques for Markers, Spiderfier and Clustering.

Read More
Topics: salesforce.com, Learning, How To, Google Maps

How to update object CRUD permissions on multiple profiles on a single page/view

Jay Sheth

A very common business scenario, whenever we create a new Object in Salesforce, we also required to update the CRUD (Create, Read, Update, Delete) permissions for this new Object in multiple profiles, as this is one of the most important and crucial security requirement.

Another common scenario is when we have to grapple with understanding the as-is configuration for a specific standard or custom Object (or a set of Objects) for an existing org, where we need to get a birds-eye view of CRUD permissions given to all the profiles for these object/s.

This is usually a very time consuming process, particularly when there are many existing profiles in the Salesforce org. We are then having to go to each profile, go to the object CRUD settings for the object/s in question, and set the permissions as needed for each profile.

Most times we wish someone could build a page which would give us a view, and ideally an editable one, for seeing and setting object CRUD permissions for all the profiles at once.

But, there is an easy way out! Many of us are not aware of the very easy point-and-click customization to achieve this requirement.

Here are the simple steps (the snapshots assume a dummy custom object called Certification):

Read More
Topics: salesforce.com, Best Practices, Learning, How To

JavaScript: Understanding the unrevealed - Part I

Rajkumar Gaikwad
JavaScript is one of the most confusing/misunderstood programming language, but also it is one of the world’s most popular programming language.
Despite it's popularity, it is such a misunderstood programming language. What’s the secret behind this?
In this blog I am going to be listing the unrevealed parts of this language and I am sure it will help you to understand the language in a better way.

JavaScript has no block level scope

What do you mean by block level scope?

Block level scope means variable declared inside a block of code that is enclosed by curly {} braces and is only visible inside that block not the outside of that block.
If a variable is visible outside that block that means programing language doesn’t support block level scope.
JavaScript has only function level scope that means whenever a particular function gets called it creates the context execution and in that it creates scope chain and variable environment .
We will see what is context execution and the difference between scope level chains and variable environment and what would be the lifetime of a variable in my next post. For now just understand that it allocates new memory locations to all the variable declared in that function and variables are accessible in that function only, which are available in scope chain and variable environment .

                For example,

                 <script>    
                             var testVariable = 1;
        
                              if(true){
                                        var testVariable = 2;
                                        console.log (testVariable);  // logs 2 as output
                               }        
                              console.log (testVariable); // logs 2 as output
                 </script>

NOTE : in ECMAScript 6 we have let keyword which allows to declare variable which has block level scope.
 

It’s a Single threaded event based language

It's a very confusing part for most of us that JavaScript is a single threaded or multi-threaded language.

Single threaded - Only one thing at a time.
Multi-threaded - More than one thing at a time.

JavaScript is a single threaded event based language, so what does event based single threaded language mean?
Everything under the hood in JavaScript is a single threaded but there are some external dependencies which can block the single threaded execution,they are modelled as event. Whatever might block that single threaded execution is queued up for processing (i.e. put into the special queue called EVENT QUEUE).
 

Whenever execution stack is empty JavaScript engine looks into this queue and check is there any event in event queue if yes execute it as in FIFO order.
 
Let’s jump to the example,



 

Flow of execution

Global execution context created --> logs ‘ Hi welcome'  - -> now click on document event gets added into event queue --> waitfor3Secs function gets called --> new execution context created for function waitfor3Secs and added it in on top stack --> after 3 second it logs ‘ wait is finished.. ’ --> popped last execution context --> Logs ‘ Execution finished...!! ’ --> finished global execution context -->execution stack is empty --> will check event queue and process event based on FIFO order by pushing each event on top of the execution stack --> now event handler gets called --> new execution context created for event handler --> logs ‘ welcome ’.

It’s a Dynamic typed language 

What does static typed mean?

In other programming language like C, JAVA if we write a statement like
 
Integer numOfCount = ‘three’;
 
It gives the compile time exception, because compiler is expecting integer typed value in variable.
 
But in JavaScript it internally typecast the variable based on type of its value as:
            
            var numOfCount = ‘three’;
            console.log (typeof numOfCount) // it logs string

 

Coercion in JavaScript

As I said above that JavaScript automatically type cast variable based on its value, because of such coercion some times JavaScript language becoemes a nightmare for developers because it produces unexpected result which weren’t expected by developer.
               
Example:
                                If (1<2<3) {
                                                console.log (‘it’s working as expected’);
                                }
 
                                If (3>2>1) {
                                           console.log (‘working as expected’);
                                } else {
                                                console.log (‘this wasn’t expected’);
                                }          
 
 JavaScript is a truly object-oriented programming language and everything is an object in js.
 Here '<' is an overloaded operator.

In the exapmple execution starts from left to right and first it calls '<' function with 3 and 2 as a parameter.
                 
            function < (param1, parm2) {
                                //…….
             }
 
This function returns TRUE because 3>2.  and next time it pass TRUE<1;             
Because of dynamic nature of js language js engine convert TRUE to 1, so expression becomes 1>1 and it returns false and logs ‘this wasn’t expected’.

Basically all these are the omissions as a part of the language designer, but if we know all these ptifalls then it really save us lots of time in debugging and helps us to understand this language in a better way.
Read More
Topics: salesforce.com, Learning, How To, JavaScript

Algorithm to convert 15-digit Salesforce record id to its 18-digit equivalent

Jay Sheth

All of us are aware that Salesforce record id's have 2 forms: 15-digit case sensitive id, and 18-digit case insensitive id. It is most important that we always use 18-digit id for all data manipulations, and not use the 15-digit one.

For facilitating this, Salesforce has already given an out-of-the-box formula function named CaseSafeID(id), which accepts the 15-digit id and returns the 18-digit equivalent.

Read More
Topics: salesforce.com, Learning, How To

How to implement "Dable" in visualforce page

Dattaraj Deshmukh

This article demonstrates the implementation of "Dable" (pronounced 'dabble')  plugin in Visualforce page for pagination, sorting and searching on the client side.

Read More
Topics: salesforce.com, Learning, VisualForce

5 key considerations when implementing a new system like salesforce

Michael Kolta

In every business there are tasks that are done based on previous experiences which are handed down from one person to the next and the process never changes.

Read More
Topics: salesforce.com, Best Practices, Learning, efficiency

5 Google Chrome Extension Every Salesforce Developer Must Know

Rajkumar Gaikwad

In today's world, time is one thing that no one has. So, we need to plan our efforts well to save our valuable time and gain maximum productivity.


In Salesforce world if you want to save your time, here are the 5 chrome extensions which will save a lot of your time.

Read More
Topics: salesforce.com, Learning, Google Chrome, How To

Retrieving relationship between business hours and holidays using apex

Lalit Mistry

Salesforce provides a means to configure business hours and holidays in the system. Admin can setup business hours for their company by simply navigating to Setup -> Company Profile -> Business Hours. The business hour configuration ensures that the system is aware of the working hours and accordingly computes target date (such as SLA of cases) and helps you to provide the correct support to your customer.

Read More
Topics: salesforce.com, Apex Programming, Best Practices, Learning

Is parameter passing in apex really passed by reference?

Lalit Mistry

Yesterday I was having a discussion with one of my colleague over parameter passing techniques in apex programming. He was pretty sure that primitives in apex are passed by values, whereas non-primitive data types are passed by reference. Well, this statement is partially correct.

Read More
Topics: salesforce.com, Apex Programming, Best Practices, Learning