Tuesday, March 29, 2016

Sunday, March 20, 2016

what is the difference between isNull and isBlank?

ISNULL:
  
  •        Determines if an expression is null (blank) and returns TRUE if it is. If it contains a value, this function returns FALSE.
  •         Text fields are never null, so using this function with a text field always returns false. For example, the formula field IF(ISNULL(new__c) 1, 0) is always zero regardless of the value in the New field. For text fields, use the ISBLANK function instead.
  •         Multi-select picklist fields are never null in s-controls, buttons, and email templates, so using this function with a multi-select picklist field in those contexts always returns false.
  •         Empty date and date/time fields always return true when referenced in ISNULL functions.
  •         Choose Treat blank fields as blanks for your formula when referencing a number, percent, or currency field in an ISNULL function. Choosing Treat blank fields as zeroes gives blank fields the value of zero so none of them will be null.
  •         Merge fields can be handled as blanks, which can affect the results of components like s-controls because they can call this function.
  •         When using a validation rule to ensure that a number field contains a specific value, use the ISNULL function to include fields that do not contain any value. For example, to validate that a custom field contains a value of ’1,’ use the following validation rule to display an error if the field is blank or any other number: OR(ISNULL(field__c), field__c<>1)

     ISBLANK:
  •      Determines if an expression has a value and returns TRUE if it does not. If it contains a value, this function returns FALSE.
  •       Use ISBLANK instead of ISNULL in new formulas. ISBLANK has the same functionality as ISNULL, but also supports text fields. Salesforce.com will continue to support ISNULL, so you do not need to change any existing formulas.
  •      A field is not empty if it contains a character, blank space, or zero. For example, a field that contains a space inserted with the spacebar is not empty.
  •      Use the BLANKVALUE function to return a specified string if the field does not have a value; use the ISBLANK function if you only want to check if the field has a value.
  •      If you use this function with a numeric field, the function only returns TRUE if the field has no value and is not configured to treat blank fields as zeroes.


Thursday, March 17, 2016

How can I create Many – to – Many relationship

Lookup and Master detail relationships are one to many relationships. We can create many – to – Many relationship by using junction object. 
Junction object is a custom object with two master detail relationships.

What is “Master-Detail Relationship"

Master Detail relationship is the Parent child relationship. In which Master represents Parent and detail represents Child. If Parent is deleted then Child also gets deleted. Rollup summary fields can only be created on Master records which will calculate the SUM, AVG, MIN of the Child records.
  • Up to 2 allowed to object.
  • Parent field on child is required.
  • Access to parent determines access to children.
  • Deleting parent automatically deletes child.
  • A child of one master detail relationship cannot be the parent of another.
  • Lookup field on page layout is required.

What is a “Lookup Relationship”

This type of relationship links two objects together,
  • Up to 25 allowed for object
  • Parent is not a required field.
  • No impact on a security and access.
  • No impact on deletion.
  • Can be multiple layers deep.
  • Lookup field is not required.

What is difference between Role and Profile

  1. Role is Record level access and it is not mandatory for all users.
  2. Profile is object level and field level access and it is mandatory for all users.


How many ways we can made field is required

  1. While creation of field
  2. Validation rules
  3. Page Layout level

How many ways we can call the Apex class

  1. Visual force page
  2. Web Service
  3.  Triggers
  4.  Email services 

What is TAB in Salesforce.

Tab is a user interface component to user creates to display custom object data.

   There are three type of tabs.

        Custom Tabs

        Visual force Tabs

         Web Tabs

What is the use of “FOR UPDATE” in SOQL

FOR UPDATE is used to lock the records.

                Ex:  Campaign cam = [SELECT id FROM Campaign LIMIT 1 FOR UPDATE];

What is the use of “ALL ROWS” in SOQL

 ALL ROWS is used for retrieving the records from recycle bin.

                         Ex:  SELECT Id from Campaign ALL ROWS

                        -> “ALL ROWS” does not work in developer console.

How to call Apex class using java script

Apex Class:
global class ClassName{
 webService static String methodName(String camName) {
            Campaign cam = new Campaign(name = camName);
            return cam.name;
       }
}
Java Script:
var Campaign = sforce.sObject(“Campaign”);
var String = sforce.apex.exceute(“ClassName”,”methodName”,{name=”ABC”});

Difference between “Export” and “Export All” in Data Loader in Salesforce

Export : It is used to export the Salesforce Data(excluding recycle bin’s data) into your local system.

Export All :  It is used to export the Salesforce Data(including recycle bin’s data) into your local system.