Custom redirection on Lead Convert operation in salesforce.com

Standard

When you convert a Lead, you will be taken to newly created Account’s detail screen. Thats the standard salesforce.com behaviour.

But what if, you want to show newly created Contact’s detail screen (instead of Account screen), upon Lead conversion? Unfortunately, there is no such setting available in salesforce (yet).

Many people might have achieved it, by some or the other workaround. And here is my trick.

  • Create following Apex Controller class, to use it along with the VF page.
    public class LeadConvertLandingController{
    
        Id newId = null;
        public LeadConvertLandingController(){
            newId = ApexPages.CurrentPage().getParameters().get('newid');
        }
    
        public PageReference redirect(){
            Lead convertedLead = [select ConvertedContactId from Lead where id=:newId];
            PageReference pRef = new PageReference('/' + convertedLead.ConvertedContactId);
            pRef.setRedirect(true);
            return pRef;
        }
    }
    
  • Create a VF page with following markup.
    <apex:page controller="LeadConvertLandingController" action="{!redirect}">
        please wait....
    </apex:page>
    
  • Create a Custom Button for Lead object, as follows:
    • Label = “Convert”.
    • Display type = “Detail Page Button”.
    • Behavior = “Display in existing window without sidebar or header”.
    • Content source = “URL”.
    • And copy below URL in the big text area.
      /lead/leadconvert.jsp?retURL=/{!Lead.Id}&id={!Lead.Id}&saveURL=/apex/LeadConvertLanding
      
  • Now edit the Lead layout and remove the standard Convert button and add the custom Convert button.
  • Thats it!

Hope thats helpful!

Note: This solution works only when, lead conversion is done with new Account/Contact during lead conversion process. It may not work, if existing Account/Contact is chosen, during lead conversion process/screens.

Life savers – very handy apps on AppExchange

Standard

Here are some of my favorite apps on AppExchange. They are all powerful tools and most of them are free!

Draggin Role
https://appexchange.salesforce.com/listingDetail?listingId=a0N300000016a6rEAA

Manage your role hierarchy with ease! Now you can drag and drop your way through any hierarchy modifications. Draggin’ Role is a free application that allows you to view and manipulate users AND roles from a single Custom Tab.

The Permissioner
https://appexchange.salesforce.com/listingDetail?listingId=a0N30000008XYMlEAO

The Permissioner dramatically reduces the time involved with assigning and revoking permission sets assignments to multiple users. Using a simple interface, administrators can select one or more permission sets to assign to one or more users at a time.

Steam Role
https://appexchange.salesforce.com/listingDetail?listingId=a0N300000016a75EAA

Slash administration times and have fun doing it! Drag and drop management of Roles, Territories, Users, Public Groups, Queues, and Record Ownership all from a powerful, Flash-based console. A ‘must have’ for any System or Delegated Administrator.

DemandTools
https://appexchange.salesforce.com/listingDetail?listingId=a0N300000016bXjEAI

DemandTools is an enterprise capable suite of data quality modules to control, standardize, verify, deduplicate, import & generally manipulate Salesforce and/or Force.com data. More than just duplicates removal, DemandTools is administrator productivity.

Field Trip
https://appexchange.salesforce.com/listingDetail?listingId=a0N30000003HSXEEA4

Ever wish you could run reports on the fields you have in salesforce? Take a Field Trip! This utility lets you analyze the fields of any object, including what percentage of the records (or a subset of your records) have that field populated.

Salesforce CRM Dashboards
https://appexchange.salesforce.com/listingDetail?listingId=a0N30000004g316EAA

Your one stop shop for GREAT example dashboards. Includes dashboards for Executives, Reps, Sales, Support and more. Checkout the documentation for details.

DupeCatcher, Real Time Deduplication
https://appexchange.salesforce.com/listingDetail?listingId=a0N30000003IYLlEAO

DupeCatcher enables Salesforce users to identify, block and dedupe leads, accounts, and contacts in real-time at the point-of-entry. Retain full control of the identification and merging process, eliminating any fear of loss while cleansing data.

Conga Composer
https://appexchange.salesforce.com/listingDetail?listingId=a0N300000016b7FEAQ

Easily create and deliver customized documents, presentations and reports using Word, PowerPoint, Excel, HTML email and PDF forms from standard & custom objects. Generate quotes, proposals, account plans, invoices, contracts, letters & more

Group Master
https://appexchange.salesforce.com/listingDetail?listingId=a0N30000003Jj1aEAC

The ultimate Group management tool for any Chatter admin!

Inline Account Hierarchy
https://appexchange.salesforce.com/listingDetail?listingId=a0N300000016chCEAQ

The Inline Account Hierarchy package contains a custom Visualforce component that displays the Account hierarchy as a collapsible tree. The component my be included directly into you own Visualforce pages or added to the standard account detail page.

Graphics Pack
https://appexchange.salesforce.com/listingDetail?listingId=a0N30000004cfIcEAI

‘Graphics Pack’ contains hundreds of images / icons that can be used in salesforce applications for tabs, image formulas, and Visualforce pages

Rollup Helper
https://appexchange.salesforce.com/listingDetail?listingId=a0N30000009i3UpEAI

Rollup Helper aggregates any Salesforce data in minutes. No coding required. Save time & money & unlock your data! Supports SUM, MAX/MIN, Formula-based Count, and Text Rollups. Rollup information using lookup relationships and through hierarchies.

Hope this helps.

Display Standard Mini Page Layout in Visualforce

Standard

Did you ever run into a situation, when you were asked to display a standard mini page layout in Visualforce, on hover of a link?

Assuming that you haven’t faced the situation, and are not sure how to go about it? Am writing this blog post, to let you know, following options available, to meet the requirement.

  1. Search and download a relevant javascript from internet, and use it in your VF page.
  2. Write your own html/javascript.
  3. Don’t reinvent the wheel. Instead, use salesforce’s standard mini page layout display mechanism.

Per my experience, options 1 & 2 are very time consuming and may not guarantee native look and feel.

However, option 3 is my favorite, as it saves lot of time and effort and is very much native. You just don’t need to write any complicated javascript/html. Instead, you will call some of the salesforce’s javascript functions. Now, that’s smart thinking.

Standard Mini Page Layout in Visualforce

Here is the Visuaforce markup, enjoy!!

<apex:page standardController="Account" recordSetVar="accounts">
<apex:pageBlock >
<apex:pageBlockTable value="{!accounts}" var="acc">
<apex:column headerValue="{!$ObjectType.Account.Fields.Name.Label}">
<a href="/{!acc.id}"
id="lookup{!acc.id}opp4"
onblur="LookupHoverDetail.getHover('lookup{!acc.id}opp4').hide();"
onfocus="LookupHoverDetail.getHover('lookup{!acc.id}opp4', '/{!acc.id}/m?retURL=/{!acc.id}&isAjaxRequest=1').show();"
onmouseout="LookupHoverDetail.getHover('lookup{!acc.id}opp4').hide();"
onmouseover="LookupHoverDetail.getHover('lookup{!acc.id}opp4', '/{!acc.id}/m?retURL=/{!acc.id}&isAjaxRequest=1').show();">
{!acc.Name}
</a>
</apex:column>
<apex:column headerValue="{!$ObjectType.Account.Fields.Type.Label}" value="{!acc.Type}" />
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>

I tried to keep it simple. However, you can create a re-usable custom component for this and use it where ever you need it.

Hope that’s helpful

Going Mobile – Technical Architect Series

Standard

Native_html5_hybridAre TAs expected to develop mobile apps?

No, they are not. However they are expected to understand pros, cons and risks associated with mobile platforms. TAs are expected to create mobile strategies while designing mobile solutions. Based on requirements, TAs are expected to zero-in on correct mobile strategy.

Why go Mobile?

Mobile apps are no longer an option, they’re a necessity now. People around the world are spending more time using mobile apps than browsing internet over their laptops or smartphones (can now be nicknamed “app phones” 🙂 )

Many enterprise companies have realized this and are now focusing on going mobile as well. And they are now willing to make their flagship products/services, available on mobile devices.

What’s inside Salesforce.com mobile SDK?

Salesforce’s Mobile SDK provides three Mobile Application Development options.

  • Native apps are specific to a given mobile platform (iOS or Android) using the development tools and language that the respective platform supports (e.g., Xcode and Objective-C with iOS, Eclipse and Java with Android). Native apps look and perform the best.
  • HTML5 apps use standard web technologies—typically HTML5, JavaScript and CSS. This write-once-run-anywhere approach to mobile development creates cross-platform mobile applications that work on multiple devices. While developers can create sophisticated apps with HTML5 and JavaScript alone, some vital limitations remain at the time of this writing, specifically session management, secure offline storage, and access to native device functionality (camera, calendar, geolocation, etc.)
  • Hybrid apps make it possible to embed HTML5 apps inside a thin native container, combining the best (and worst) elements of native and HTML5 apps.

Deciding factors

At times choosing the right option might get tricky. But if your requirements are clear and you are absolutely sure what you want? Then it becomes much easier to pick the right option. While working on your mobile strategy you will have to base your decisions on following factors (but not limited to)

  1. Platform (IOS or Android)
  2. Your development team’s skills.
    Could include HTML5, Javascript, CSS, Java, Eclipse, etc…
  3. Access to native components (like camera, calendar, etc.)
  4. Offline Data Storage capabilities.
    A must have feature when you want your users to be able to work even without internet access. And can synch  whenever internet access is available.

Here are some useful links:

http://wiki.developerforce.com/page/Mobile

http://wiki.developerforce.com/page/Webinar:_IntroMobileSDK

Hope that’s helpful.

Abstract class and Interface – Technical Architect Series

Standard

While designing any solution, we often spend good amount of time preparing coding standards, guidelines, best practices, etc… The idea behind such effort is to make sure that the chosen design is implemented with ease and quality work is delivered. Having a good design can have a profound influence on success of any implementation.

A good design needs to be robust and scalable. The code should be structured and reusable. There is no place for redundant code in a good design. Hence it is very important to understand different ways by which we can write less and reusable code.

By using Abstract classes and Interfaces developers can design robust and scalable solutions.

Are TAs expected to write classes and interfaces?
Yes in some cases and no in most cases 🙂 Even if you (as a TA) are not writing code, then you are expected to

  1. Have a clear understanding of how Abstract classes and Interfaces can be leveraged for a good design?
  2. Guide the development teams to a right design approach. If needed, teach them how to work with abstract classes and interfaces.

What is an Abstract Class?

An abstract class is just like any other class, having properties and methods. However it has following characteristic which makes it different from other classes.

  1. It can have executable methods and abstract methods.
  2. It can only subclass one abstract class.
  3. It cannot be instantiated.
  4. It can only be extended by other classes (called subclasses).
  5. Its abstract methods must be overridden by its subclasses.
  6. Its non-abstract methods cannot be overridden by its subclasses.

An example abstract class

public abstract class MasterDataHandler{
    //executable method
    public MasterDataService initMasterDataService(){
        MasterDataService objMasterDataService = new MasterDataService();
        /**
	your code goes here....
	**/
        return objMasterDataService;
    }

    //abstract method, which should be overridden by extending class.
    public abstract Boolean doSynch();
}

Examples of extending classes (sub classes)

public class AccountSynchHelper extends MasterDataHandler{
    public override boolean doSynch(){
        return true;
    }
}
public class ContactSynchHelper extends MasterDataHandler{
    public override boolean doSynch(){
        return true;
    }
}

What is an Interface?

An interface is like a class in which none of the methods have been implemented—the method signatures are there, but the body of each method is empty. To use an interface, another class must implement it by providing a body for all of the methods contained in the interface.  Interface has following attributes that makes it different from abstract classes.

  1. It has no implementation code.interface
  2. All its methods are abstract by default.
  3. A class can implement any number of interfaces.
  4. An interface can extend another interface.
  5. As with classes, when an interface extends another interface, all the methods and properties of the extended interface are available to the extending interface.

Please refer below links for more information

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_defining.htm
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_interfaces.htm
Hope that’s helpful.

SSL and TLS – Technical Architect Series

Standard

We talk about firewalls and proxies and their rules to secure access to your resources. But have you ever wondered, what is the underlying mechanism, to secure your traffic between requests (browser) and responses (server)? Well, the answer is Secure Sockets Layer (a.k.a SSL).

Are TAs expected to setup SSL/TLS?
Nope, they are not. However, TAs are expected to understand how SSL/TLS works. If you ever get stuck with issues related to certificates/security. You (as a TA) are expected to co-ordinate with client’s technical teams to tell them what needs to be done? to resolve the issues.

What is SSL?
TLS and its predecessor, SSL, are cryptographic protocols that provide communication security over the Internet.

SSL was developed by Netscape and if you google and check its history, you will be astonished to know that its first version  was never used and second version was hardly used and its third version (SSL3) enjoyed little adoption and usage.

And you will be equally amazed to know that actual SSL technology (developed by Netscape) is no longer used. It’s just the name that floats around but the fact is actual SSL technology is no more used. Instead a new technology has emerged and is widely used these days. It’s called Transport Layer Security (a.k.a TLS).

How do I secure my server resources with SSL?
Just install the server certificate on the server and make sure that your application applies that server certificate to itself, thats it. Your application resources will be secure. Once installed, SSL will allow HTTPS:// to function on server.

What is a certificate?
In simple words, a Certificate is block of information in a cryptographic manner, essentially telling the other computers that I am who I say I am. Certificates are used for either authenticated single sign-on with an external website, or when using your organization as an identity provider.

  • You only need to generate a Salesforce.com certificate if an external website needs verification that a request is coming from a Salesforce.com organization. (I.e. your Salesforce instance).
  • You can generate a self-signed certificate (signed by Salesforce) or a CA-signed certificate (must be sent to a CA[Certificate Authority] to sign)

What is a two way certificate or client certificate?
In some cases HTTPS:// is not sufficient. After the initial security handshake is done, the customer might expect salesforce.com to prove that it actually is salesforce.com when salesforce.com is calling a customer resource. A couple of examples of that are:

Salesforce sends client certificate as part of

  1. Outbound messages
  2. Delegated authentication callout.

Some important things to note are:

  1. In salesforce, custom client certificates can be created and used within the app.
  2. Salesforce does not expect your client applications to send client certificates to salesforce. But Salesforce does send a client certificate as part of every outbound callouts, outbound messages, etc.

How does it work?
One important ground rule is, both client and the server should support SSL/TLS for a secure communication to happen. If browser supports and server doesn’t, then the connection cannot be established and communication won’t happen.

Since protocols (HTTP, FTP, etc..) can operate either with or without TLS (or SSL), it is necessary for the client to indicate to the server whether it wants to set up a TLS connection or not. There are two main ways of achieving this; one option is to use a different port number for TLS connections (for example port 443 for HTTPS). The other is to use the regular port number and have the client request that the server switch the connection to TLS using a protocol specific mechanism (for example STARTTLS for mail and news protocols).

Once the client and server have decided to use TLS they negotiate a stateful connection by using a handshaking procedure. During this handshake, the client and server agree on various parameters used to establish the connection’s security. Here are some of the initial events that occur during a secure communication.

  1.  The client (browser) sends the server the client’s SSL version number, cipher settings, session-specific data, and other information that the server needs to communicate with the client using SSL.
  2. The server sends the client the server’s SSL version number, cipher settings, session-specific data, and other information that the client needs to communicate with the server over SSL. The server also sends its own certificate, and if the client is requesting a server resource that requires client authentication, the server requests the client’s certificate.
  3.  The client uses the information sent by the server to authenticate the server. If the server cannot be authenticated, the user is warned of the problem and informed that an encrypted and authenticated connection cannot be established. If the server can be successfully authenticated, the client proceeds to the next step.

Hope that’s helpful.