Karthik online training

Thursday, 30 July 2015



                                                                  Vlookup
 
Hi All, 

 I came with one more interesting concept, V look up in Salesforce.
Q: First of all will see why salesforce introduce the Vlookup?
Ans: By using Vlookup, we will match the values in your organization.
Example:
I am taking custom objects
    1.       Candidate
    2.       Positions
EX: if Candidate already applied for that position or that particular position then we will add the validation.

First what’s the syntax of Vlookup:
VLOOKUP(field_to_return, field_on_lookup_object, lookup_value) ,
Steps to Create Vlookup:

Step 1:
Creating 2 Custom objects Candidate, Positions
Step 2:
Add the validation on Candidate custom Object



Step 3:
(VLOOKUP($ObjectType.Position__c.Fields.Name ,  $ObjectType.Position__c.Fields.Name ,  Applying_Position__c)) !=   Applying_Position__c
In the above code first we specify the Return type means, 
it will return all the Position Names in your org,
Second Parameter is, I am passing the value to Position object nothing but I am comparing Candidate Apply position with Position Name. If it matches then we are returning the first Parameter.
Third one is value in Candidate object.
Finally I am comparing the return type and Applying position in Candidate object if it match then we are allowing to store the data,
If it’s not matching, i will show an error message given below





Important points about Vlookup:

   1.    VLOOKUP available only in the  Validation Rules.
   2.    The field_to_return must be an auto number, roll-up summary, lookup relationship, 
      master-detail relationship, checkbox, date, date/time, email, number, percent, phone picklist,          text, text area, or URL field type.
3.       The field_on_lookup_object and lookup_value must be the same data type.

Hope you like this Concept.
Have a great day. Tomorrow i will come with one more interesting concept.


No comments:

Post a Comment