Action Status on radio button change in Salesforce

Sample Code:

Visualforce Page:

<apex:page id="pg">
<apex:actionstatus id="counterStatus">
    <apex:facet name="start">
        <div class="waitingSearchDiv" id="el_loading" style="background-color: #fbfbfb; height:100%;opacity:0.65;width:100%;">
            <div class="waitingHolder" style="top: 100px; width: 91px;">
            <img class="waitingImage" src="/img/loading.gif" title="Please Wait..." />
            <span class="waitingDescription">Loading...</span>
            </div>
        </div>
    </apex:facet>
</apex:actionstatus>
<apex:form >
    <apex:pageBlock >
        <apex:pageBlockSection columns="2">
            <apex:pageBlockSectionItem >
                <apex:outputLabel value="Gender"/>
                <apex:selectRadio >
                    <apex:selectOption itemLabel="Male" itemValue="m"/>
                    <apex:selectOption itemLabel="Female" itemValue="f"/>    
                    <apex:actionSupport event="onchange" status="counterStatus" reRender="pg"/>                
                </apex:selectRadio>   
            </apex:pageBlockSectionItem>   
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:form>
</apex:page>

Output:



Cheers!!!

Missing redirect_uri parameter error from Facebook

If you face, "Missing redirect_uri parameter error from Facebook" issue, add redirect_uri parameter to the end point URL.

The redirect_uri should be the callback URL.

Get the callback URL and pass it to the redirect_uri parameter in the endpoint URL to fix this issue.

Cheers!!!

Text(Encrypted) field in Salesforce

Implementation Notes
  • Encrypted fields are encrypted with 128-bit master keys and use the Advanced Encryption Standard (AES) algorithm. You can archive, delete, and import your master encryption key. To enable master encryption key management, contact Salesforce.
  • You can use encrypted fields in email templates but the value is always masked regardless of whether you have the “View Encrypted Data” permission.
  • If you have created encrypted custom fields, make sure your organization has secure connections using SSL (Secure Sockets Layer) enabled.
  • If you have the “View Encrypted Data” permission and you grant login access to another user, be aware that the other user will be able to see encrypted fields unmasked (in plain text).
  • Only users with the “View Encrypted Data” permission can clone the value of an encrypted field when cloning that record.
  • Only the <apex:outputField> component supports presenting encrypted fields in Visualforce pages.

Restrictions
Encrypted text fields:
  • Cannot be unique, have an external ID, or have default values.
  • For leads are not available for mapping to other objects.
  • Are limited to 175 characters because of the encryption algorithm.
  • Are not available for use in filters such as list views, reports, roll-up summary fields, and rule filters.
  • Cannot be used to define report criteria, but they can be included in report results.
  • Are not searchable, but they can be included in search results.
  • Are not available for: Salesforce Classic, Connect Offline, Connect for Outlook, Salesforce for Outlook, lead conversion, workflow rule criteria or formulas, formula fields, outbound messages, default values, and Web-to-Lead and Web-to-Case forms.
Best Practices
  • Encrypted fields are editable regardless of whether the user has the “View Encrypted Data” permission. Use validation rules, field-level security settings, or page layout settings to prevent users from editing encrypted fields.
  • You can still validate the values of encrypted fields using validation rules or Apex. Both work regardless of whether the user has the “View Encrypted Data” permission. Data for encrypted fields in the debug log isn’t masked because users who have access to the debug logs have access to all data in the organization.
  • Existing custom fields cannot be converted into encrypted fields nor can encrypted fields be converted into another data type. To encrypt the values of an existing (unencrypted) field, export the data, create an encrypted custom field to store that data, and import that data into the new encrypted field.
  • Mask Type is not an input mask that ensures the data matches the Mask Type. Use validation rules to ensure that the data entered matches the mask type selected.
  • Use encrypted custom fields only when government regulations require it because they involve additional processing and have search-related limitations.
Cheers!!!

What is an external ID in Salesforce?

When importing custom objects, solutions, or person accounts, you can use external IDs to prevent duplicate records from being created as a result of the import operation. An external ID is a custom field that has the “External ID” attribute, meaning that it contains unique record identifiers from a system outside of Salesforce. When you select this option, the import wizard will detect existing records in Salesforce that have the same external ID. Note that this operation is not case-sensitive - for example, “ABC” will be matched with “abc”. However, there is an exception: if the custom field has the separate “Unique” attribute and the case-sensitive option for that attribute is selected, uppercase and lowercase letters will not be considered identical.

The fields with below data types can only be external Id

1. Number
2. Text
3. Email

When a field is made as external Id, the field will be automatically indexed. Additionally, if you have an external ID field, the field becomes searchable in the sidebar search. You also can use the upsert API call with the extenal ID to refer to records.

If we create External Id field, it will be indexed by default by Salesforce.

During upsert operation,

1. If External Ids are matched, it will update the record.

2. If External Ids are not matched, it will create a new record.

3. If External Ids are matched more than once, it will throw an error.

How to set a field as External Id field?


Cheers!!!

Which type of relationship can standard objects maintain?

The standard object can maintain only Lookup relationship.

The standard object can be child to other object (standard or custom) only through Lookup relationship not via Master Detail relationship.


Cheers!!!

Roles of Salesforce Administrator

The roles and responsibilities of realtime Salesforce administrator are

1. Setting up users.

2. Setting up Roles and Responsibilites.

3. Adding users to Queue, Public Groups, Chatter Groups, Permission Sets, etc...

4. Creating reports for data validation.

5. Loading new data.

6. Freezing and unfreezing users during Bulk Data Load, Sandbox refresh and multiple deployments.

7. Informing users before Sandbox refresh.

Cheers!!!

Roles of Salesforce Developer

The Roles of Salesforce Developer are
  • Developing Apex Classes for Visualforce pages
  • Developing Triggers for the application
  • Have written Batch Apex for notification
  • Developing Test classes for all the Apex classes and Triggers with minimum 95% code coverage for triggers and classes
  • Designing user friendly Visualforce pages as per the requirements
  • Integrating with 3rd Party applications and servers
  • Developing Components for re-usability
Note:
These are all few roles of the Salesforce Developers. The Salesforce Developers even do administration tasks and so on.

Cheers!!!

Salesforce Beginners Guide

PING command in Windows 7

Before executing the Ping command, copy and paste the below code in command prompt

dir %SystemRoot%\System32\ping.exe
path %path%;%SystemRoot%\System32

After the execution of the above command, now try to use Ping command.

Example:
Ping www.google.com

Cheers!!!

External lookup relationship

Use an external lookup relationship when the parent is an external object.

An external lookup relationship links a child standard, custom, or external object to a parent external object.

When you create an external lookup relationship field, the values of the standard External ID field on the parent external object are matched against the values of the external lookup relationship field. For a child external object, the values of the external lookup relationship field come from the specified External Column Name.

Steps to create external lookup relationship:

1. Go to Setup --> Develop --> External Data Sources and create External Data Source.


2. Go to Setup --> Develop --> External Objects and create External Object.


3. Go to Setup --> Create --> Objects and select the object under which you want to create external lookup relationship.


Cheers!!!

How to get total number of roles in Salesfore?

Sample SOQL:

SELECT COUNT(Id) FROM UserRole

Cheers!!!

Setting up Role Hierarchies - Best Practices

It's important to spend the time setting up the role hierarchy because it's the foundation for the entire sharing model.

A role hierarchy represents a level of data access that a user or group of users needs.

An organization is allowed 500 roles; however, this number can be increased by Salesforce. As a best practice, keep the number of non-portal roles to 25,000 and the number of portal roles to 100,000. As a best practice, keep the role hierarchy to no more than 10 levels of branches in the hierarchy.

Modeling the role hierarchy begins with understanding how the organization is structured. This is usually built from understanding a manager’s scope, starting from the top. The CEO oversees the entire company. The CEO usually has direct reports that can then be segmented by Business Unit (Sales or Support) or geographical region (EMEA, APAC). That person then has direct reports that could be further segmented, and so on.

The role name should represent the roles and responsibilities.

Cheers!!!

How do I make my app live on Facebook?

1) Go to https://developers.facebook.com and select your app under Apps menu.

2) Click Status & Review


3) At the top of the Status & Review page you should see "Do you want to make this app and all its live features available to the general public?" with a toggle (no/yes) switch.

4) Click the toggle switch so it displays "Yes".

Cheers!!!

How to delete an App from Facebook?

1. Go to "https://developers.facebook.com/". Click "Create a New App".

2. Go to Apps menu and select the app.

3. Click 'Delete App'.


Cheers!!!

How to delete an application in LinkedIn

1. Open the Application.

2. Scroll down to the end of the page.

3. Click 'Delete Application'.


4. Confirm it by clicking 'Delete Application'.


Cheers!!!

Scope value in Linkedin

Example:

&scope=r_basicprofile%20r_emailaddress

Check the scope in the application created


Cheers!!!

Salesforce Opening

We have openings at COGNIZANT on SALESFORCE

Exp: 2 to 12years.
Note: Any SFDC Certification will be plus
Note: You should be ready to travel anywhere within India 

Interested can send your CV's to referel1988@gmail.com

Cheers!!!

How to login into Salesforce using Linkedin credentials?

1. Create a Linkedin app using the below link

"https://www.linkedin.com/secure/developer?newapp="

Note: Make sure Default Scopes are selected.



2. Save the application Details.


3. Create Auth Provider in Salesforce.




4. Modify the handler class as below

Handler Class:

global class AutocreatedRegHandler1416835537727 implements Auth.RegistrationHandler{
    global User createUser(Id portalId, Auth.UserData data) {
        User u = [SELECT Id FROM User WHERE Email =: data.email OR FirstName =: data.FirstName];
        return u;
    }
    
    global void updateUser(Id userId, Id portalId, Auth.UserData data) {
    }
}

5. Copy the callback URL.


6. Paste it in Linkedin App.


7. Use "Single Sign-On Initialization URL" to login into Salesforce using Linkedin Credentials.


8. Click "Allow Access" to login into Salesforce using Linkedin credentials.


Cheers!!!

How to query user information from Role?

Sample Query:

SELECT Id, Name FROM User WHERE UserRole.Name = 'Executive'

Cheers!!!

How to move listview using Apache ANT tool?

Sample Package.xml:

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>Account.My_Account_Team</members>
        <name>ListView</name>
    </types>
    <version>32.0</version>
</Package>

here 'My_Account_Team' is the List View Name.

Cheers!!!

How to move custom button using Apache ANT tool?

Sample Package.xml:

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">

   <types>
        <members>ObjectName.ButtonName</members>
        <name>WebLink</name>  
    </types>
    <version>28.0</version>
</Package>


Cheers!!!

Salesforce Interview questions with answers Part 25

1. Below is the code snippet , How to get the code coverage for the constructor?

public class test {
boolean flag;
public test(){
if(flag == true) {
String s= 'blue';
}
if(flag == false) {
String s= 'red';
}
}
}

Answer:

public class test {
    @testVisible static boolean flag;
 
    public test() {
        if(flag == true) {
            String s= 'blue';
        }
        if(flag == false) {
            String s= 'red';
        }
    }
}

@isTest
public class testClass {
    static testMethod void testMtd() {
        test.flag = true;
        test t = new test();
        test.flag = false;
        t = new test();
    }
}

2. How to access the variables of the inner wrapper class(InnerWrapper) in VF Page for the below code

public class Main {

public class Outerwrapper {

public String outerwrap{get;set;}
public Outerwrapper(String m){
}
public class InnerWrapper {
public String innerwrap{get;set;}
public InnerWrapper(String s){
}
}

}

}

Ans:
Salesforce doesn't support more than 1 level of inner classes.

3.How do you monitor future calls in Salesforce Standard UI ?

Setup --> Jobs --> Apex Jobs

4.How to pass list of checkboxes checked using javscript to controller class ?

Set the id to the checkbox and get the value using JS.

5.How do you distinguish between xml and json in Rest API Call while invoking web service?

JSON is the default. You can use the HTTP ACCEPT header to select either JSON or XML, or append .json or .xml to the URI (for example, /Account/001D000000INjVe.json)

Cheers!!!

How to move Managed Package profile and permission set permissions using ANT tool?

Package.xml:

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>Name Prefix__Component Name</members>
        <name>Component</name>
    </types>
    <types>
        <members>*</members>
        <name>PermissionSet</name>
    </types>
<types>
        <members>*</members>
        <name>Profile</name>
    </types>
    <version>30.0</version>
</Package>

Note:
Here Component Name is the name of the component and Component is Salesforce component.

Example:
Package.xml:

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>aaBB__Sample</members>
        <name>ApexPage</name>
    </types>
    <types>
        <members>*</members>
        <name>PermissionSet</name>
    </types>
<types>
        <members>*</members>
        <name>Profile</name>
    </types>
    <version>30.0</version>
</Package>

Cheers!!!

How to set Signature in IBM Lotus Notes?

1. Click File --> Preferences.


2. Click Mail and click the Signature tab.


3. Select Automatically append a signature to the bottom of my outgoing mail messages.

4. Enter text in the Signature field. Click the T control to add rich text features such as graphics and attachments.

5. Optional: Click Append My vCard, and then change any of the information in the fields if needed.

6. Optional: Click Append vCard to Signature.

7. Optional: To move the vCard file to a location other than following your signature, cut and paste it to the new location.

8. Click OK.

Cheers!!!

Recycle Bin - Salesforce

The Recycle Bin link in the sidebar of Salesforce.com lets you to view and restore recently deleted records for 15 days before they are permanently deleted. Your Recycle Bin record limit is 25 times the Megabytes (MBs) in your storage. For example, if your organization has 1 GB of storage then your limit is 25 times 1000 MB or 25,000 records. If your organization reaches its Recycle Bin limit, Salesforce automatically removes the oldest records if they have been in the Recycle Bin for at least two hours.

Note:

After 15 days, the records will be permanently deleted. So, in order to retrieve data deleted after 15 days, kindly contact Salesforce.com support.

Cheers!!!

STORAGE_LIMIT_EXCEEDED issue in Salesforce

If you face STORAGE_LIMIT_EXCEEDED issue in Salesforce, Go to Setup --> Administer --> Data Management --> Storage Use.


Note:
If you breach one storage limit, your organization is effectively read only

Cheers!!!

How to create JSON String using Apex in Salesforce?

Sample Code:

String strJSON;
strJSON = JSON.serialize(listJSONWrapper);

here listJSONWrapper can be wrapper class list or sObject list.

Cheers!!!

Difference between Sales Cloud and Service Cloud

Kindly check the below link for Sub modules of CRM

http://www.infallibletechie.com/2013/05/sub-modules-of-crm.html

Sales Cloud:

Sales Cloud refers to Sales module in CRM. Sales module include Lead Conversion, Account Management, Opportunity Management, etc.

Service Cloud:

Service Cloud refers to Service module in CRM. Service module includes Case Management, etc

Cheers!!!

Salesforce Certified Force.com Developer - Winter '15 Maintenance Exam

Kindly use the below link for quick updates of Winter '15 release

http://www.infallibletechie.com/2014/10/salesforcecom-winter-15-release-updates.html

Release Training:

http://www.salesforce.com/customer-resources/releases/winter15/release-training.jsp

Release Notes:

https://na1.salesforce.com/help/pdfs/en/salesforce_winter15_release_notes.pdf

You will have 3 attempts to pass the exam. There are 5 exam questions and the passing score is 80%.

We have to complete the online exam by February 27, 2015, prior to the next release (Spring ‘15).

For more info, visit http://certification.salesforce.com/schedules.

Cheers!!!

Salesforce Certified Administrator - Winter '15 Maintenance Exam

Kindly use the below link for quick updates of Winter '15 release

http://www.infallibletechie.com/2014/10/salesforcecom-winter-15-release-updates.html

Release Training:

http://www.salesforce.com/customer-resources/releases/winter15/release-training.jsp

Download the Release Notes here:

https://na1.salesforce.com/help/pdfs/en/salesforce_winter15_release_notes.pdf

You will have 3 attempts to pass the exam. There are 6 exam questions and the passing score is 67%.

We have to complete the online exam by February 27, 2015, prior to the next release (Spring ‘15).

For more info, visit http://certification.salesforce.com/schedules.

Cheers!!!

How to roundup to nearest nickel in Salesforce using formula?

Sample Formula:

(CEILING(Field__c/ 0.05) )*0.05

Cheers!!!

How to create SVN repository and connect with Salesforce using Eclipse?

Prerequisites:

Make sure Subclipse is installed in Eclipse.

If Subclipse is not installed, kindly follow the below steps

1. Go to Help --> Eclipse Marketplace.


2. Install Subclipse.


Follow the below steps after installing Subclipse.

1. Go to File --> New --> Other.


2. Select "Checkout Projects from SVN".


3. If you don't have the repository location, select "Create a new repository location" else select "Use existing repository location" and select the main repository location.


4. Select the trunk or branch for your organization.


5. Right click the project -->  Force.com --> Add/Remove Meta Data Components.


6. Click "Add/Remove".


7. Select the componets.

8. Click "Ok".

9. Click "Apply".

Cheers!!!

How to load data from CSV file to Salesforce.com using Informatica?

Repository Manager:

Go to Folder -> Create to create a Folder.


PowerCenter Designer:

1. Tools --> Source Analyzer


2. Source --> Import flat file.


3. Tools --> Targer Designer.


4. Target --> Import from Salesforce.com


5. Tools --> Mapping Designer

6. Drag and drop source, source analyzer will be automatically created.

7. Drag and drop target.

8. Map the source with target

PowerCenter Workflow Manager:

1. Connection --> Application Connection.

2. Select Salesforce.com.

3. Click "New".

4. Enter the username and password(security token is must if you are accessging out of IP ranges).

5. Task --> Create Task.

6. Select Session.

7. Tools --> Workflow designer.

8. Drag and drop Task.

9. Point Start to Task

10. Workflows --> Start Workflow

Cheers!!!

How to count number of child records in lookup relationship in Salesforce?

Sample Trigger:

trigger HobbyTrigger on Hobby__c (after insert, after delete) {
    map<Id, Integer> mapEmpIdHobbyCount = new map<Id, Integer>();
    if(trigger.isInsert) {
        for(Hobby__c hob : trigger.new) {
            if(hob.Employee__c != null) {
                if(!mapEmpIdHobbyCount.containsKey(hob.Employee__c)) {
                    mapEmpIdHobbyCount.put(hob.Employee__c, 1);
                } else {
                    mapEmpIdHobbyCount.put(hob.Employee__c, mapEmpIdHobbyCount.get(hob.Employee__c) + 1);
                }
            }
        }
    } else {
        for(Hobby__c hob : trigger.old) {
            if(hob.Employee__c != null) {
                if(!mapEmpIdHobbyCount.containsKey(hob.Employee__c)) {
                    mapEmpIdHobbyCount.put(hob.Employee__c, -1);
                } else {
                    mapEmpIdHobbyCount.put(hob.Employee__c, mapEmpIdHobbyCount.get(hob.Employee__c) - 1);
                }
            }
        }
    }
    if(mapEmpIdHobbyCount.size() > 0) {
        List<Employee__c> listEmp = [SELECT Id, Number_of_Hobbies__c FROM Employee__c WHERE Id IN : mapEmpIdHobbyCount.keySet()];
        
        for(Employee__c emp : listEmp) {
            emp.Number_of_Hobbies__c += mapEmpIdHobbyCount.get(emp.Id);
        }
        
        update listEmp;
    }
}

Cheers!!!

How to find the Server Instance of Production for custom domain?

1. Go to Setup --> Domain Management.

2. Check the Right Frame URL value.

Cheers!!!

Valid PowerExchange for Salesforce.com license key is not found issue

For Valid PowerExchange for Salesforce.com license key is not found issue, kindly check whether the PowerExchange for Salesforce.com license key is present.

Cheers!!!

Missing Connection for Session for Salesforce in Informatica Powercenter issue

1. Create a connection for Salesforce in Connections menu.


2. Select "Salesforce Connection".


Cheers!!!

Import from Salesforce.com option missing

In order to avoid Import from Salesforce.com option missing issue, kindly close the PowerCenter Designer and open it again.

Cheers!!!

Source analyzer in Informatica is disabled issue

Kindly create a folder in Repository Manager under the active Repository.

Check the below image for creating folder in Repository.


Cheers!!!

How to start, stop and control services on startup of Windows?

1. Go to Control Panel.

2. Select "Administrative Tools".


3. Click "Services".


4. Right Click the Service you want to start, stop and control services on startup of Windows.


5. In Startup Type, select your desired choice.


Cheers!!!

How to fix pmora8.dll missing issue in Informatica?

Check whether the installed Informatica server and Database(Oracle, Sybase, etc..) are for same for your version of OS.

For example, if you have 32-bit version of OS, make sure that your Oracle and Informatica server are for 32-bit version of OS.

Also check whether the environment variables are set properly in system and user variables.

Cheers!!!

How to read a csv file and show it on a Visualforce page?

Sample Code:

Visualforce Page:

<apex:page controller="Sample">
<apex:form >
    <apex:pageBlock id="pg">
        <apex:pageBlockButtons location="bottom">
            <apex:commandButton value="Show" action="{!show}"/>
        </apex:pageBlockButtons>
        <apex:pageBlockSection >
            <apex:pageBlockSectionItem >File<apex:inputFile value="{!fileForExport}"/></apex:pageBlockSectionItem>
        </apex:pageBlockSection>
    </apex:pageBlock>
   
    <apex:pageBlock rendered="{!showBool}">
        <apex:pageBlockTable value="{!listOutput}" var="o">  
            <apex:repeat value="{!o}" var="i">
                <apex:column value="{!i}"/>
            </apex:repeat>
        </apex:pageBlockTable>
    </apex:pageBlock>
</apex:form>
</apex:page>

Apex Class:

public class Sample {
    public Blob fileForExport {get;set;}
    public Boolean showBool {get;set;}
    public String output {get;set;}
    public List<List<String>> listOutput {get;set;}

    public Sample() {
        showBool = false;
        listOutput = new List<List<String>>();        
    }
    
    public void show() {
        showBool = true;
        output = fileForExport.toString();
        List<String> tempList = new List<String>();
        tempList = output.split('\n');
        for(String str : tempList) {
            listOutput.add(str.split(','));
        }
    }
}

Output:


Cheers!!!