We Have moved to www.allaboutsfdc.com

This Blog has moved to ALL ABOUT SFDC

Chitika

Sunday, November 21, 2010

Junction Object or Many to Many Relationship in SFDC

There is no out of box relationship present in SFDC i.e. Many to Many in nature, So to have a many to many relationship in SFDC a JUNCTION OBJECT is required.

A junction object joins the two objects with two master detail relationship. Junction object is always on the detail side of the object.

                                   Obj1  M : 1  Junction  1 : M  Obj2

This way junction object creates Many to Many relationship between Obj1 and Obj2. (DEV 401 Question)

One example of many to many relationship among standard objects is Case and Solution. One case can have many solution attached to it and one solution can be used in resolving many cases.

Saturday, November 20, 2010

Concept behind Validation Rules in SFDC

Purpose: Validation rules are written to maintain the integrity of the data.

Mandatory fields while writing a validation rule are Name, Formula and Error Message.

Name: Unique name of validation rule

Formula: The formula is written in a way that it evaluates to true for the condition in which you do not want your record to be saved.

Business Case: If opportunity stage is negotiation then discount is mandatory.
          
Formula for Business Case:       Ispickval(stage,'negotiation') && Isblank(discount)

Error Message: This is the message which will be displayed to the business users. The thumb rule is that it should be Short and Crisp.

Location of error message:
Error message can be placed at two places:
Top of the page: Displays error message  at the top of the page
@ field: Displays error message at the field

Wednesday, November 17, 2010

HTML Tags in SFDC Field Labels

The SFDC allows you to use the HTML tags in the SFDC field label. This way you can now make a field label Red in color or underline a field label or do anything as per your business requirements.

Some of the limitations are:

  • The 80 character limit on the SFDC field label still applies. So HTML tag needs to be less then 80 characters.

  • In reports instead of HTML name you see the HTML Tag which means you can not see these fields in the reports. The workaround is to create one more formula field in report and display that field with HTML field value.

VLookup Function in SFDC

There are some of the functions which can not be used with formula fields and one such function is vlookup.

This function is only used in the validation rules.

Vlookup works exactly the same way the Lookup function works in excel and helps in maintaining the integrity of your data.

Business Use Case: We want to make sure, the discount entered is as per the master table shared by the organization based on n variables.

Monday, November 15, 2010

Difference between LookUp relationship and Master - Detail relationship in SFDC

Lookup relationship is an example of loosely coupled relationship whereas Master-Detail is an example of Tightly coupled relationship.

  • In tightly coupled (M-D relation) when we delete the parent record, all child records are also deleted but nothing of this sort happens in loosely coupled (Lookup relation). Sure shot ADM 201,CON 201, DEV 401 question.

  • In M-D relation, a person who can view the master can see all the detail records of that master as the their is no owner on the detail side records and detail side gets its access properties from the master. Nothing of this sort happens in the Lookup relation as both objects have owners.

  • Roll up summary field can be made on Master Detail relation but not on the Lookup relationship.

  • One detail side record can have maximum 2 masters but no limit on the Lookup fields. DEV 401 certification question.

  • Standard objects can never be on the detail side of the master detail relationship but no such thing in a Lookup relation. (ADM 201)

Sunday, November 14, 2010

How to make the Rich Text Field Mandatory by a Validation Rule

If you want to make the Rich Text Field Mandatory in SFDC by a Validation rule then ISNULL, ISBLANK  functions will not work. You will require to use the LEN (Length) Function and make sure the validation rule looks like

                        IF LEN (Rich Text Field) == 0 then fire the Validation Rule

with this approach the validation rule will make sure the Rich Text field always has the value.

Business Case:- Make Other (Rich Text Field) Mandatory when the Reason (Picklist Field) is selected as Others.


Note:- ISNULL was previously used for the Numeric fields whereas Length function was used for Text field. Now ISBLANK is a new function which can be used for both the Text as well as the Number field.

Saturday, November 13, 2010

Different Ways to make a field mandatory in salesforce.com

As we know there are different standard ways of making a field mandatory in SFDC. This is a brief about all of those ways. Sure shot CON 201 and ADM 201 Question :-)

  • Make a field Required while creating it by checking the Required check box:- This makes that field required for everyone in the organization. In other words this is like making the field required from Field Level security.  
    • This will be used if the requirement says " I want to make sure that all sfdc users should enter Salary Amount in the payment details record"

  • Make a Field required via Page layout:- This is done to make sure that for that particular Page layout this field is mandatory and for others it is not.
    • The Requirement will be like " I want to make salary amount mandatory in payment details object for salary pagelayout but not for Interviewed people in Interviewees salary pagelayout"

  • Make a field required by a Validation Rule:- This is to make sure that a field is mandatory on a particular condition.
    • The Requirement will be like "Make the Salary Amount mandatory if the  Interview status says Selected"
Certification Question:-  Difference between FLS and Page Layout ( How will you make a field Required and why)

 Note:- Please add if I have missed any other Standard Way :-)