Sunteți pe pagina 1din 15

Table of Contents

Exercise 1-1: Creating Formula Fields to Display images..................................................................1

Exercise 1-2: Creating Formula Fields to Display Hyperlinks..............................................................3

Exercise 2-1: Creating Validation Rules........................................................................................6

Exercise 2-2: Building Validation Rules to Enforce Conditionally Required Fields...................................8

Exercise 2-3: Building Validation Rules to Enforce Data Format........................................................10

Exercise 2-4: Building Validation Rules to Enforce Consistency........................................................11

Exercise 2-5: Creating Validation Rules to Prevent Data Loss.....................................................14

Exercise 3-1: Creating Workflow Rules.......................................................................................16

Exercise 3-2: Setting Up Time-Dependent Workflow.......................................................................20

Exercise 3-3: Setting Up Time-Dependent Workflow (Optional).........................................................22

Exercise 4-1: Creating Outbound Messages.................................................................................24

Exercise 5-1: Auditing Changes Using Setup Audit Trail.................................................................25

Exercise 5-2: Auditing Changes to Data......................................................................................29


Goal:

B ui l d a for mul a fi el d th at di s pl a ys an i ma ge.

Scenario:

Universal Containers would like to add a visual indicator of the Rating on a job application. Job
Applications with a high rating should display a green flag; a medium rating should display a yellow
flag; and a low rating should display a red flag. Universal Containers can take advantage of a number
of sample images available on the Salesforce servers.

Tasks:
Create a new formula field to show a red, yellow, or green flag on a job application record,
depending on the Average Review Score.
Add the new Rating field to the Job Application related list on the Position page layout.

Time:10 minutes

Instructions:

1. Create a new custom formula field


a. Click Your Name I Setup | Create | Objects |Job Application
b. Scroll down to the Custom Fields & Relationships related list and click New
i. Data Type: Formula

c. Cl i ck Next

i. Field Label: Rating

0. Field Name: Rating

i. Formula Return Type: Text

d. Cli ck Next

i. Enter the following formula: IF( Average_Review_Score c >= 3 .


5,
IMAGE( 1/img/samples/light_green.gif", "Green") ,
IF(Average_Review_Score c >= 2.5,
IMAGE("/img/samplesnight_yellow.gif", "Yellow") ,
IMAGE("/ing/samples/light_red.gif", "Red") ) )

ii. C l i c k Ch e c k S y n t a x

e. Cl i ck Next

Make the field visible to all profiles Click Next

Add the field to the Job Application Layout

g. Click Save
2. Test the customization by looking at a job application record to see the new Rating field
Click the Job Applications tab

i. View: All

G ii Click Go!

Click the job application record, APP 0000

i. Note the new Rating indicator.

ii. Add the new Rating field to the Job Application related list on the Position page
layout

iii. Click Your Name I Setup I Create I Objects I Position

iv. Scroll down to the Page Layouts related list, then click the Edit link next to the Technical
Position
Page Layout

v. Click the wrench icon on the Job Applications related list

vi. Move Rating from the Available Fields column to the Selected Fields column

vii. Apply column information to other page layouts: Select All: checked

viii. Click OK, then click Save

f
Exercise 1-2: Creating Formula Fields to Display Hyperlinks
Goal:
Build a formula field that displays a hyperlink.

Scenario:
Universal Containers would like to be able to click a link on the candidate object to see a photo of the candidate. The
images will be stored in the Documents tab, so the company will need to create a field to capture the ID, a field to
create the URL, and a field with a link that users can click to see the picture, as well as embedding the image into
the page.

Tasks:
Create a field for the Picture ID.
Populate a candidate record's Picture ID field, then click the Picture Link to view the picture.

Time: 15 minutes
Instructions:
1, Create a new field for the image ID.
a. Click Your Name I Setup I Create I Objects I Candidate
b. Scroll down to the Custom Fields & Relationships related list and click New
i. Data Type: Text
c. Click Next
iii. Field Label: Picture ID

iv. Length: 18
v. Field Name: Picture ID
d. Click Next

i.Make the field visible to all profiles

e. Click Next

i. Add the field to the Candidate Layout


f. Click Save & New
i . D a t a Ty pe : Formula

N Next
g. Click
F i e l d L a b e l : Picture URL

ii. Field Name: Picture_URL


iii. Formula Return Type: Text
h. Click Next
Formula: I F ( IS B L A N K ( P i c t u r e _ I D _ _ C ) ,
" /servietiservlet.FileDownload?file=" &
Picture__ID__C )

0. Cl i ck Check Syntax
Click Next
Make the field visible to all profiles, click Next
i.Add the field to the Candidate Layout
0. Cl i ck Save & New

vi. D at a Ty p e: F o r m u l a

I. Click Next
I. Field Label: P i c t u r e L i n k

vii. Field Name: P i c t u r e L i n k

viii. Formula Return Type: Text


N
m. Click Next

Formula: IF ( IS B LA N K ( P i c t u r e ID c )
HYPERLINK ( iservlet/servlet .FileDownload? file= " &
P i c t u r e I D c "candidate P i c t u r e " ) )
0. Cl i ck Check Syntax
h
n. Make the field visible to all profiles, click Next
i. Add the field to the Candidate Layout

o. Click Save & New


i . Data Type: Formul a
N p. Click Next

P Field Label: P i c t u r e

P Field Name: P i c t u r e

Formula Return Type: Text


q. Click Next

iv. Formula: I M A G E ( P i c t u r e _ U R L c , " P i c t u r e " )

0. Cl i ck Check Syntax

r. Click Next
s. Make the field visible to all profiles, click Next
i. Add the field to the Candidate Layout
t. Click Save
2. Populate a candidate record's Picture ID field, then click the Picture Link to view the picture
a. Click the Documents tab
i. Select the folder, Public Photos
0. Click on one of the documents listed, then copy the last 15 digits of the URL
for that document (everything after .com/)

i. Click the Candidates tab

ii. Click any Candidate

iii. Click Edit

iv. i. Paste the ID of the


photo you selected from the document into the Picture Id field

v. C l i c k Save
vi. Note how the Picture URL is populated, then click on the Candidate
Picture link
Exercise 2-1: Creating Validation Rules
Goal:
C
Create validation rules to enforce business requirements.

S
Scenario:

Universal Containers (UC) wants reviewers to always provide specific details if they are
recommending someone for hire. Additionally, UC employees should not be able to save a
position record unless the Hiring Manager field is filled out.

T
Tasks:
Add a validation rule that requires people to fill in the Reason Recommended box if they check
Recommend for Hire. Add a validation rule that requires that all positions must have a Hiring
M
Manager listed.
Time: 10 minutes

Instructions

1. Create a new validation rule


Click Your Name I Setup I Create I Objects I Position
In the Validation Rules related list, click New
L Name: E v e r y Position Must Have a Hiring Mgr

Active: Checked

Description: Every position record must have a hiring manager.

L Error Condition Formula: LEN( Hiring Manager c ) = 0

t Click Check Syntax to verify your formula

Error Message: Every Position must have a Hiring Manager

Error Location: Field I Hiring Manager

C. Click Save

d . Create new a Position and a new Review record to test these validation rules
Exercise 2-2: Building Validation Rules to Enforce Conditionally Required Fields

Goal:
Build a validation rule that prevents users from saving Temp positions with a blank

Duration.

S
Scenario:

Universal Containers would like to enforce its policies around Temporary positions. The
Duration field on a Temp position should not be blank. It should contain a value between 1 and
365.

T
Tasks:

B a new validation rule that ensures that these policies are followed.
Build

S the Debug Log to track actions that you take.


Set

Create a new position to test that the validation rule works.

Time: 1 0 mi n u t e s

Instructions:

1. Create a new validation rule

a. Click Your Name I Setup I Create Objects I Position

b. Scroll down to the Validation Rules related list and click New

ix. Rule Name: Temp Position Validation

x. Active: Checked

xi. Description: Temporary positions require a value for


Duration between 1
and 365 days.
Error Condition Formula: ISPICKVAL( Type
xii. _c , "Temp")
&&
c (BLANKVALUE(Duration c,0)<=0 II Duration c >365) _
EffrorMlessage:Temporary positions require a value for Duration
between 1 a n d 3 6 5 d a y s .

xiii. Error Location: Field : Duration

c. Click Save

2. Set the Debug Log to track actions that you take.

ix. Click Your Name I Setup I Monitoring I Debug Logs

x. Click Ne w

i. Select the checkbox next to the Admin User

xi. C l i ck S a v e

3. Create a new position to test that the


validation rule works. a. Click the Positions
tab

Click New

c . R e c o r d T yp e of n e w r e c o r d : N o n T e c h n i c a l P o s i t i o n s
-

d. Click Continue
A I. Title: Assistant to the Director of Support

H Priority: High

T Type: Temp

Status: New

V . Department: S u p p o r t

xiv. Date Opened: today's date

xv. Pay Grade: 5-100

xvi. H i r i n g M a n a g e r : Frank Linstrom

xvii. Job Description: T h e A s s i s t a n t t o t h e D i r e c t o r o f S u p p o r t


is a diverse and fast- paced role supporting the director of our
2 5 0 p e r s o n s u p p o r t organization.

e. Click Save
f . A f t e r r e c e i v i n g t h e e r r o r : " T e m p o r a r y P o s i t i o n s r e q u i r e a v a l u e f o r d u r a t io n be t w e e n
and 365 days , " enter the Duration as 364, then click Save again
4. Check the Debug Logs

xii. Click Your Name I Setup I Monitoring I Debug Logs

xiii. Click the View link next to the first listing (at the bottom of the list) for Admin User to view

the logs i. Note the result: VALIDATION_FAIL

xiv. Click the View link next to the second listing for Admin User to view the logs
i. Note the result: VALIDATION_PASS

Exercise 2-3: Building Validation Rules to Enforce Data Format

G
Goal:

Build a validation rule that enforces proper data format.

S
Scenario:

Universal Containers would like to make sure that when candidates are entered, the zip code is
entered in the correct format.

T
Tasks:

Create a validation rule on candidates that requires that zip codes be entered in a valid 5-digit or 9-
digit format.

T
Time:

10 minutes

Instructions:
Create a validation rule on candidates that requires that zip codes be entered in a valid 5-digit or 9-
digit format.

a. Click Your Name I Setup I Create j Objects I Candidate

b. Scroll down to the Validation Rules related list and click New
i. Rule Name: Zip code must be Valid US Postal Code

Active: Checked

Description: Validates that the candidate Zip/Postal Code is in 99999 or


99999-9999 format if Country is USA or US.

Error Condition Formula: (Country c == "USA" 11 Country c == "US") &&


NOT(REGEX(Zip_Postal_Code c,"(-1\d{4})?"))
Error Message: Zip code must be in 99999 or 99999-9999 format.
Error Location: Field : Zip/Postal Code

c. Click Save
2. Test the validation rule on an existing candidate

Click the Candidates tab

From the View picklist, select All, then click Go!

I. Click any Candidate, then click Edit


ii. Country: us

iii. Zip Code: 9410


After receiving the following error, "zip code must be in 99999 or 99999 -

9999 format," update the zip code to 94105 and click Save

Exercise 2-4: Building Validation Rules to Enforce Consistency

Goal:G

Build a validation rule that enforces data consistency.

S Scenario:

I Universal Containers would like to ensure that when a zip code is entered, it matches the state that's
entered. For example, a candidate with a California zip code should not have a state of New York.

T
Tasks:

Create a validation rule that checks the zip code entered against a table to validate that the zip code
and state match.

T
Time:

15 minutes

Instructions:
1. Create an object on which to store zip code data

a. Click Your Name I Setup I Create I Objects I New Custom Object

i. Singular Label: zip code

P lural Label: zip Codes

xviii. Object Name: Z ip_Code

xix. C o n t e x t S e n s i t i v e H e l p S e t t i n g : Open the standard Salesforce Help & Training


window

xx. Record Name: Zip Code

xxi. Data Type: Text

xxii. Allow Reports: Checked

xxiii. Allow Activities: Not checked

xxiv. Track Field History: Not checked

X. Development Status: Deployed

Xi. Launch New Custom Tab Wizard after saving this custom object: Checked

b. Click Save

xv. Use the lookup icon to select the Map tab style

xvi. C l i c k Next

xvii. Make the tab Default On for all Profiles, then click Next

xviii. Include the tab in the Recruiting application only

xix. C l i c k Save

2. Create additional fields on the Zip Code object


N Custom Fields & Relationships, click New
a. Under

Data Type: Text

b, Click Next

Field Label: state

2 v. Length: 2

Field Name: State

c. Click Next

i. Make the field visible to all profiles

d. Click Next
i. Add the field to the zip code layout

e. Click Save & New


i. Data Type: Text

f. Click Next

xxv. Fi el d Label : Ci ty

xxvi. Length: 80

ii. Field Name: City

g. Click Next
i. Make the field visible to all profiles

h. Click Next
i. Add the field to the zip code layout

i. Click Save
j. Modify the Zip Code page layout so that the fields are displayed in a logical order

xx. Under the Page Layout related list, click the Edit link next to Zip Code Layout

(1) Arrange the fields in the left hand column of the page layout so that City is on top, then
State, then Zip Code

xxi. Click S a v e

3
3. Create new zip code records

t Click the Z i p C o d e s tab

Click N e w

i. Enter the Zip Code, City and State for any location.
S Cli ck S a v e

Repeat to create 3 to 5 zip code records (to look up Zip Codes for any
city go to

S-ar putea să vă placă și