Friday, September 19, 2014

How to manage your Data in Salesforce.com


How to use Upsert in Salesforce?

How to import Data by using Data import wizard in Salesforce?

How to take an Export Data in Salesforce?

How to do a Mass Transfer of Records in Salesforce?

How to do a Mass Delete of Records in Salesforce?

How to use a Data Loader in Salesforce?

How to use SOAP API and REST API in Salesforce?


For all the answers to the above questions check out this document:
How to manage data in Salesforce.com

Microsoft Office Add-in For Salesforce.com

Salesforce Certification Preparation Lab-2

Refer to the second part of the certification here. For the first part, scroll down

Salesforce Certification Preparation Lab-2

Salesforce Certification Preparation Lab-1

Refer to this well explained document here: Salesforce Certification Preparation Lab1

Vlookup Function in Salesforce


An example would be suppose that you are creating Employee(a custom object) records in the SF org. Now since Employees are very important records, you do not want the users to create duplicate Employee again and again. For example, say one User already created an Employee Record with name - John Doe. Now, an another User who does not know about this tries to create an another Employee record with the same name - John Doe . and hence there is a potential duplication. This should not be allowed.

So you have two options now:
  1. Add a Validation Rule on the Employee which checks whether there are any existing Employee records with the same name if so stop the User from saving it. Here comes the role of VLOOKUP.
  2. Create an Apex Trigger(before Insertbefore Update) which runs a SOQL query to get all the Employee records in the Org with same name as of the one thats getting created now. If the number of records is 1 then stop the User from creating the Employee using an addError method. This will require considerable development effort.
Now, since we are interested in VLOOKUP lets see as of how we can do the same. Create a Validation Rule as below:

(4) Name = VLOOKUP(
(1) $ObjectType.Employee__c.Fields.Name ,
(2) $ObjectType.Employee__c.Fields.Name ,
(3) Name)
 

Now, our basic requirement is to check if an another Employee with the same Name exists or not. So its obvious we are looking into the Name field. The logic is quite simple compare the Name (4) on the Current Record and theName on that Employee record that matched with the same Name as of the one that we are creating now. Hence we use the equality operator (=).

Lets look into the VLOOKUP side. You could express the VLOOKUP formula as below: "Look into the Name(2) field on all the Employee Records and return value in it's Name (1) field if the it happens to be same as the Name(3) on the Current Record."

The SFDC Document define VLOOKUP as follows:

VLOOKUP(field_to_returnfield_on_lookup_objectlookup_value)
 
Searches an object for a record where the specified field matches the specified lookup_value. If a match is found, returns another specified field value.

Points to Remember:
  1. VLOOKUP only available on Custom Objects. Vote for this idea: https://success.salesforce.com/ideaView?id=08730000000BqPs
  2. VLOOKUP only available in Validation Rules.
  3. VLOOKUP can only be done on the Name fields.
  4. The field_to_return must be an auto numberroll-up summarylookup relationshipmaster-detail relationshipcheckboxdatedate/timeemailnumberpercentphonepicklisttexttext area, or URLfield type.
  5. The field_on_lookup_object must be the Record Name field on a custom object.
  6. The field_on_lookup_object and lookup_value must be the same data type.

Friday, December 2, 2011

Salesforce Training in Hyderabad India

We conduct trainings in Salesforce.com ADM 201 and DEV 401 modules.
The duration of the classes for each module would be 30 days.
The mode of training would be Classroom/ Online as you prefer.


For further info contact me at logicbenefit@gmail.com or call me at 9908196405