Professional Documents
Culture Documents
Scenario:
• The first step in creating any Force.com App is to create the container to hold all
of the associated objects, tabs, etc. The simplest app contains only the default
Home tab, and a default logo.
• We will now create a custom Recruiting app for Universal Containers and
associate their logo with it. As we build more functionality into our app, we will
add it to this application container.
Time:
• 5 minutes
Instructions
1. Click Setup | Create | Custom Apps
2. If you see the splash page, click Continue
3. Click New
4. Step 1: Enter the Details
a. Label: Recruiting
b. Description: enter a brief description
c. Click Next
5. Step 2: Choose the Image Source for the Custom App Logo
Click Insert an image
a. File Location: Corporate Graphics
b. Click the link for the Universal containers.gif file
c. Click Next
6. Step 3: Choose the Tabs
a. Select Reports, Documents, Dashboards, Interviewers, Candidates,
Positions, and Job Applications from the Available Tabs and move them
to the Selected Tabs box
b. Click Next
Review
1. How do you switch applications as a user in the Salesforce user interface?
________________________________________________________________
________________________________________________________________
________________________________________________________________
________________________________________________________________
Scenario:
• Universal Containers (UC) is currently using a spreadsheet to track interview
reviews. This is a very inefficient process that is difficult to manage.
• In order to improve this process and make it more efficient, UC has decided to
create a custom object to track reviews. All internal communication and activity
relating to a review should be tracked on this object. In addition, users should be
able to run reports on this object.
Time:
• 5 minutes
Instructions
8. Click Setup | Create | Custom Objects
9. Click New Custom Object
10. Enter the Custom Object Information
a. Label: Review
b. Plural Label: Reviews
c. Object Name: Review (should be auto-populated)
d. Description: enter a brief description
11. Enter Record Name Label and Format
a. Record name: Review Name
b. Data Type: Auto Number
c. Display format: REV-{0000}
d. Starting Number: 1
12. Select Optional Features
a. Check Allow Reports
b. Check Allow Activities
c. Check Track Field History
Review
3. What database object is similar in concept to a custom object? What further
advantages does a Salesforce object provide?
________________________________________________________________
________________________________________________________________
________________________________________________________________
________________________________________________________________
Scenario:
• Universal Containers wants to make sure that users will be able to easily access
the new Candidate object. They need to create a new custom tab that will
quickly guide people to this information.
Time:
• 5 minutes
Instructions
1. Click Setup | Create | Custom Tabs
2. In the Custom Object Tabs section, click New
3. Enter the Details
a. Object: Review
b. Tab Style: Thermometer
c. Splash Page Custom Link: leave blank
d. Description: enter a brief description
e. Click Next
4. Add to Profiles
a. Select Apply one tab visibility to all profiles: Default On
b. Click Next
5. Add to Custom Apps
a. Uncheck all applications except the Recruiting application
b. Check the box to Append tab to users’ existing personal customizations
6. Click Save
Review
1. If you do not create a custom tab for your object, is the data still accessible?
2. When selecting the Default Off option on the tab profile information, how can
users make the tab visible?
________________________________________________________________
________________________________________________________________
3. Why might you choose to not create tabs for some Salesforce objects?
________________________________________________________________
________________________________________________________________
Scenario:
• Universal Containers has identified several fields that need to be available on the
Candidate custom object.
Alternate Position Text Area(255) Help Text: Other positions that this
candidate might be better suited for.
Cultural Comments Text Area (255)
Cultural Fit Number (1,0)
Experience Number (1,0)
Experience Comments Text Area (255)
Job Application Master-Detail (Job Related List Label: Reviews
Application)
Leadership Comments Text Area (255)
Leadership Skills Number (1,0)
Recommend for Hire Checkbox Default: Unchecked
Overall Score Formula (Number) Decimal Places = 2, Create the following
formula using the Advanced Formula tab:
( Cultural_Fit__c +
Experience__c +
Leadership_Skills__c + IF(
Recommend_for_Hire__c , 5,
1) ) / 4
Time:
• 10 minutes
Instructions
1. Click Setup | Create | Custom Objects | Review
2. In the Custom Fields & Relationships related list, click New
3. Follow the steps to create the custom fields listed in the table above
Review
1. What is the difference between a Master-Detail and a Lookup relationship?
________________________________________________________________
________________________________________________________________
________________________________________________________________
________________________________________________________________
Scenario:
• Universal Containers wants to make sure that the newly created fields are
displayed in a logical order on the page. The fields should be arranged according
to the chart below.
Overall Score
Cultural Fit
Cultural Comments
Experience
Leadership Skills
Leadership Comments
Alternate Position
Time:
• 5 minutes
Instructions
Review
1. What purpose do the sections serve in a page layout?
________________________________________________________________
________________________________________________________________
________________________________________________________________
________________________________________________________________
Goal(s):
• Add a validation rule to ensure that the duration value must be entered for temp
positions.
Scenario:
• Universal Containers hires part-time, full-time employees and temporary
positions. To account for this, a Type field is on the Position object. Often, when
a new temporary position is created the record creator forgets to specify the
duration of the engagement.
• By using validation rules we can conditionally require that in order to save a
position record the duration must be specified that is a number greater than zero
if the Type field value is equal to Temp.
Time:
• 5 minutes
Instructions
1. Click Setup | Create | Custom Objects | Position
2. In the Validation Rules related list, click New
3. Enter the Validation Rule Details
a. Name: Temp_Duration_Validation
b. Active: True
c. Description: We must require that the duration is specified
if the position type = Temp
d. Error Condition Formula: AND( ISPICKVAL( Type__c , "Temp"),
NULLVALUE(Duration__c, 0) <=0 )
e. Error Message: Duration required when Type = “Temp”
f. Error Location: Field | (Duration)
4. Click Check Syntax to verify your formula
5. Click Save
6. Click on the Position tab and create a new position to test this validation rule
________________________________________________________________
________________________________________________________________
2. Are validation rules executed when loading data through the API or the Data
Loader? Are there exceptions?
________________________________________________________________
________________________________________________________________
3. If a new rule is created and there is data already stored that violates that rule,
when will Salesforce catch the problem?
________________________________________________________________
________________________________________________________________
Scenario:
• At Universal Containers, standard users (who are not recruiters), hiring
managers, or interviewers, are only allowed to view position data. There will
never be any position that a standard user is not permitted to see.
Standard users are not ever allowed to edit any position records.
• What must the OWD for position data be in Universal Containers’ Recruiting
application? Implement this OWD for Universal Containers.
Time:
• 5 minutes
Instructions
1. Click Setup | Security Controls | Sharing Settings
2. If you see a splash page, click Set Up Sharing
3. Click Edit to edit the Organization Wide Defaults
4. Set access on the Position object to Public Read Only
5. Click Save
Review
1. What are the two questions that you should ask yourself when trying to decide
how to set OWD permissions for an object?
________________________________________________________________
________________________________________________________________
2. What is fundamentally different about the way OWDs affect data than all of the
other data access controls?
Scenario:
• Establish sharing rules at Universal Containers to accomplish the following:
• Grant recruiters read and update access to every position, candidate, job
application, and review record in the application.
Time:
• 5 minutes
Instructions
1. Click Setup | Security Controls | Sharing Settings
2. If you see the splash page, click Set Up Sharing
3. In the Position: Sharing Rules related list, click New
a. Positions: owned by members of: Public Groups | Entire
Organization
b. Share with: Roles and Subordinates | VP Human Resources
c. Access Level: Read/Write
d. Click Save
e. Click OK to the dialog box that appears warning that This operation
could take significant time
4. Repeat for the Candidate and Job Application objects
Review
1. Are the users who are part of the VP Human Resources role able to share
positions that they are granted access to through this rule?
________________________________________________________________
________________________________________________________________
________________________________________________________________
________________________________________________________________
3. Try repeating the process to share records for the Review object. What is the
reason for what you find?
________________________________________________________________
________________________________________________________________
Scenario:
• Establish manual sharing at Universal Containers to accomplish the remaining
access levels: Grant hiring managers read access on candidates where they are
the hiring manager. Grant interviewers read access on job application and
candidate records for people they are interviewing.
Time:
• 5 minutes
Instructions
1. Select a position record you want to share (Note: This must be accomplished on
a record by record basis by the owner, manager of owner, or system
administrator of a record)
a. Click the Positions tab
b. Select a position (you may need to click Go next to the view to populate a list
of positions), and take note of the Hiring Manager
c. Click Sharing
2. User or Group Sharing
a. Click Add
b. Search: Users
c. Add the Hiring Manager user on the position to the New Sharing box with
Access Level: Read/Write
d. Click Save
3. Note: This would have to be repeated for each specific object record to be
shared as required
Review
2. Who are the three types of users that can grant sharing privileges on a given
record?
________________________________________________________________
________________________________________________________________
Scenario:
• AW Computing used to keep position, candidate, and job application information
in a series of Excel spreadsheets. As part of the switch over to the new
Salesforce Recruiting application, the old Excel data was consolidated into CSV
files that need to be uploaded into Salesforce.
Time:
• 10 minutes
Instructions
1. Install the Data Loader if it is not previously installed by double-clicking the
installer located at C:\AppExchangeLabExercises\ApexDataLoader.exe
and keep all of the installation defaults
2. In Windows Explorer, navigate to the C:\dataload\bin directory
3. Double-click fileGrep.exe to replace the tokens in the command line scripts
with your own username
4. When prompted, enter your class org username and click Run (You should
receive a message stating that 2 files were updated)
5. Double-click the dataload.bat file located at C:\dataload\bin to start the
data load using the command line scripts
6. Upon completion of the data load, examine the contents of the
C:\dataload\conf folder to view the load setup and the C:\dataload\data
folder to see the CSV data
7. Log into the application and verify that the loaded data can be seen there (Do not
forget to change the objects views to All to see all records)
Scenario:
• The IT staff at Universal Containers (UC) wants to learn how the Web Services
API works. Help UC modify existing sample query code and SOQL syntax to
display open Position data from their org.
• Choose your preferred development language: Java, VB.Net, or C#.Net. Note
that the instructions for Java and the .Net languages will vary slightly.
Time:
• 15 minutes
Instructions
1. Generate the WSDL
a. Click Setup | Develop | API
b. Click the Download Enterprise WSDL link
c. Save to the WSDL to the root C:\ directory as
Enterprise_version.wsdl
For Java:
2. Double-click the Eclipse application shortcut located on your desktop (If
prompted for a workspace, select the default and check the box to always use
the default workspace before continuing on)
3. Create a new project
a. From the menu, select File | New | Project…
b. Select Java project and click Next
c. Project name: OpenPositions
d. Click Next
e. Click on the Libraries tab
For .Net:
2. Select Start | Microsoft Visual Studio 2005 | Microsoft Visual Studio 2005
3. Create a new project
a. Select File | New | Project…
For Both:
6. In the OpenPositions code, locate the getPositions() method /
Positions() subroutine and write a SOQL query for the variable
queryString that retrieves the Name, Type, and Status fields for all positions
where Status=Open to replace input SOQL query string here!
7. Test the code via the following methods
Review
1. Is the Salesforce WSDL programming language independent? If so, why are
there separate code files for each language?
________________________________________________________________
________________________________________________________________
2. Why did we not just use Select * from Position__c for our query?
________________________________________________________________
________________________________________________________________
3. Would this code work for a large number of open positions? What would we
need to change to make it scalable?
________________________________________________________________
________________________________________________________________
Goal(s):
• Install the Force.com Explorer and use it examine the schema.
• Practice creating SOQL queries using the Force.com Explorer.
Scenario:
• Universal Container’s IT staff wants to examine their org’s metadata. Help them
download and install the Force.com Explorer. Examine Universal Container’s
metadata with the describeGlobal and describeSObject API calls used by
the Force.com Explorer. Create SOQL statements from the user interface and
run them against your Salesforce org.
Time:
• 10 minutes
Instructions
1. Download the Force.com Explorer from the Apex Developer Network (ADN) or
locate in the local directory
C:\AppExchangeLabExercises\ApexExplorer.zip
2. (Note: you will need to log into the ADN with your Developer Edition credentials
to access the Force.com Explorer page)
3. Browse to www.salesforce.com/developer
4. Select Tools under the Apex Wiki sidebar
5. Locate the Development Tools section and click the Apex Explorer link to
access the page
6. Click Apex Explorer to download the Explorer
7. Unzip the downloaded file
8. Run the installer, accepting all defaults
9. Run the Explorer by double-clicking on the Apex Explorer icon on the desktop
10. Enter your username and password for the org you wish to inspect
1. Examine your orgs schema using the SOQL Tester tab and answer the following
questions below
salesforce.com proprietary/confidential: customer internal use only
©2000-2007
- 25 -
Review
1. Write a SOQL query to bring back the IDs of all positions and their related job
applications. How is the relationship of the parent object (Positions) and its child
object (Job Applications) reflected in the query structure?
________________________________________________________________
________________________________________________________________
2. Write a SOQL query to bring back the IDs of all positions and their related hiring
manager’s first and last names. How is the relationship of the child object
(Positions) and its parent object (Hiring Manager = User) reflected in the query
structure?
________________________________________________________________
________________________________________________________________
3. Looking at the answers above, how do you know when to use the two different
structures when creating SOQL queries?
________________________________________________________________
________________________________________________________________
Scenario:
• To reduce the number of clicks recruiters must make to view Candidate
information for a Job Application, Universal Containers (UC) has decided to
create an inline s-control on the Job Application page layout that includes
Candidate information. The s-control will render a custom HTML page that
reveals the basic contact information of the Candidate associated to the Job
Application.
• The user experience is important to UC, and therefore the custom HTML page
should look and feel seamless to the user as if both the objects were part of the
same page.
Time:
• 5 minutes
Instructions
1. Click Setup | Create | Custom Objects | Job Application
2. In the Page Layouts related list, click the Edit link next to the Job Application
Layout
3. Click Create New Section
a. Name: Candidate Information
b. Columns: 1 (Single)
c. Click OK
4. Double-click in the new Candidate Information section
a. Width=100%
Review
1. Notice that the inline section has the look and feel of the rest of the Salesforce
user interface. How is this accomplished?
________________________________________________________________
________________________________________________________________
2. Try editing a job application. Does this inline section appear on the edit page as
well? Why or why not?
________________________________________________________________
________________________________________________________________
3. Could this inline section be added into a related list section? Why or why not?
________________________________________________________________
________________________________________________________________
Scenario:
• Universal Containers (UC) wants to create a custom HTML form to replace the
standard UI associated with the creation of a Review object. UC wants to kick off
this custom HTML form when the interviewer clicks the New Review button.
When the interviewer submits the custom HTML form, the field data should be
saved into a new Review record associated to the Job Application.
• Help UC override the New button of the Review object to display the custom
HTML form.
Time:
• 5 minutes
Instructions
1. Click Setup | Create | Custom Objects | Review
2. In the Standard Buttons & Links related list, click the Override link for the New
button
3. Select the Custom S-Control: New Review
4. Click Save
5. Click the Review tab to test the customization by clicking New and notice the
warning message
6. Click the Job Application tab to test the customization by clicking on one of the
job applications and then clicking New on the Reviews related list
7. Fill out the form and click Save
Review
1. Does this override New only on that related list, or is it globally overridden for
reviews?
2. Examine the code to find the JOB_LIST_LINK and notice that it is hard-coded to
be the URL prefix for the destination page. What would be a better solution?
________________________________________________________________
________________________________________________________________
Scenario:
• Universal Containers receives numerous job applications per position. Once a
position has been closed it requires a great deal of effort (clicks) to close out
each job application associated to the position. Users would like a button to
perform a mass update on a position’s job application records that are in an
Open status to close them.
• Update the records’ Status to Closed and set the Stage to Closed –
Position Closed. Job Application records that are in a Hold or Closed
status should not be updated by the button.
Time:
• 60 minutes
Instructions
1. Click Setup | Create | Custom Objects | Position
2. In the Custom Buttons & Links related list, click New
a. Label: Close Applications
b. Name: Close_Applications
c. Display Type: Detail Page Button
d. Behavior: Display in new window
e. Content Source: Custom S-Control
f. Custom S-Control: Close_Applications - version
i. Click Save
ii. Click the Window Open Properties
iii. Width = 300
iv. Height = 200
v. Click Save
3. Click the Back to Custom Objects: Position link
Scenario:
• Due to the critical nature of the position, some positions require that the
employee live within a 30 mile radius of the site. In the past, recruiters had to
manually evaluate this distance for new candidates for these positions.
• One of the requirements for the application is to provide a simple way to see
where a candidate is located. Create a custom link to pop-up a mash-up of
Salesforce and Google Maps data.
Time:
• 5 minutes
Instructions
1. Click Setup | Create | Custom Objects | Candidate
2. In the Custom Buttons and Links related list, click New
a. Label: Map Candidate
b. Display Type: Detail Page Link
c. Behavior: Display in new window
d. Content Source: URL
e. URL: http://maps.google.com/maps?f=q&hl=en&q={!
Candidate__c.Street_Address_1__c }+{!
Candidate__c.City__c }+{! Candidate__c.State_Province__c
}&om=1
f. Click Save and notice the message regarding adding this link to a page layout
3. Click Window Open Properties
a. Width (in pixels): 600
b. Height (in pixels): 600
c. Click Save
4. Click the Back to Custom Object: Candidate link
Note: Although it is not vital to understand for this lab, you may be interested in the
parameters submitted in the request to the Google Maps API:
a. f=q means that this request takes the form of a query
b. hl=en means that the host language is English
c. q=… gives the address for the query
d. om=1 provides a true value for the opening of the overview map
Review
1. What are the requirements for integrating using this method?
________________________________________________________________
________________________________________________________________
________________________________________________________________
________________________________________________________________
3. Can this feature be used to pop up a new window that displays a different page
within Salesforce?
________________________________________________________________
________________________________________________________________
Scenario:
• Users are now so accustomed to closing out job application records using a
single button they now want a button that performs a mass action to reject job
application records they have selected regardless of the state of the position.
Time:
• 40 minutes
Instructions
1. Click Setup | Create | Custom Objects | Position
2. In the Page Layout related list, click Edit next to the Position Page Layout
a. Double-click the Job Applications related list
b. In the Custom Buttons section, add the custom list button Reject
Applications - version to the Selected Buttons
c. Click OK
3. Click Save on the Position Page Layout page
4. Click Setup | Create | Custom Objects | Job Application
a. In the Custom Buttons & Links related list, click Edit next to the Reject
Applications custom list button
b. Write the complete JavaScript code in the button editor
• Easy: Put the returned records into an array
• Medium: Same as Easy, plus use the records for a retrieve call to get
further fields and write a function to update the fields
• Hard: Write the entire code, including what is required for Medium
c. Use Quick Save to save your work often
Scenario:
• Universal Containers (UC) wants to restrict min/max salary information on
positions to only those employees with a compelling need to know. UC has an
internal database that is used to store approved salary ranges for the various
positions and levels across departments.
• An application needs to be built to allow appropriate Salesforce users to view
salary information stored in the salary database for a position.
Time:
• 60 minutes
Instructions
1. Choose your development language: Java, VB.NET, or C#.NET
2. Prepare your environment for working with the SalaryConsole project
a. Java:
i. In the Eclipse IDE, close any open projects by right-clicking the project
and selecting Close
ii. Select File | Import | Existing Projects into Workspace…
iii. Browse to C:\AppExchangeLabExercises\Java\SalaryConsole
iv. Click Finish
v. Double-click the client code located in the project under
com.sforce.Salary.java
vi. Note that when you test, the console will appear in the output pane at the
bottom of the Eclipse IDE
b. .NET
i. In Windows Explorer, double-click the following file:
C:\AppExchangeLabExercises\.Net
language\SalaryConsole\SalaryConsole.sln
Scenario:
• Universal Containers is having trouble with their API console application after the
latest upgrade by Salesforce. Salesforce Support has been contacted and has
requested the SOAP requests and responses.
• Capture the SOAP messages generated from the login and query operations
of the API Console Application.
Time:
• 5 minutes
Instructions
1. Open the SalaryViewer project in either Eclipse or Visual Studio
2. Modify the endpoint of the binding to point at TCPMon (or TCPTrace):
http://locahost:8081/services/Soap/c/9.0
3. Open TCPMon (or TCPTrace) with the following parameters set (if you need to
change these, make sure that it is stopped first):
a. Listen on Port: 8081
b. Forward Destination Server: server-api.salesforce.com (You will
need to determine the appropriate server to insert above, such as: na1, eu0)
c. Destination Port: 80
4. Run the console application from the previous lab
5. Toggle over to TCPMon or TCPTrace to view captured SOAP messages
Review
1. If you know what the XML looks like, can you just send the XML directly into the
API? Is it possible to do this via an HTTP monitoring tool such as TCPMon?
2. What problems might you encounter regarding TCPMon and passwords? How
could you get around this?
________________________________________________________________
________________________________________________________________
Scenario:
• The SalaryConsole application successfully allowed proper users to view and
edit salary information for a position, but deploying a console application to users
is extremely cumbersome. UC has decided to turn the Console application into a
Standalone Web Control so they don’t need to install it separately for each
user.
• Deploying it as a web control also allows them to present a cleaner UI to users
and better control the type of actions a user can make.
Time:
• 40 minutes
Instructions
1. Choose your development language: Java, VB.NET, or C#.NET
2. Prepare your environment for working with the SalaryStandAloneControl
project
a. Java:
iv. Copy the entire
C:\AppExchangeLabExercises\Java\SalaryStandAloneContro
l directory and paste it into C:\apache-tomcat-5.5.20\webapps
folder
v. In Eclipse, select File | Import | Existing Projects into workspace
vi. Browse to the same Tomcat folder you just pasted at C:\apache-
tomcat-5.5.20\webapps\SalaryStandAloneControl
vii. Locate the Main.java file under WEB-INF/src/… and complete the
code in the validateUser() method
viii. Complete the code in the Login.java file as well
Scenario:
• The SalaryStandAloneControl application successfully solved deployment
problems that Universal Containers was having. However, users began to
request that the SalaryControl be integrated seamlessly into the Salesforce
application so they wouldn’t have to toggle between the two applications.
• UC has decided to re-architect the application as an integrated web control so
that users will not have to provide login credentials nor enter the Position Id of
the Position record.
Time:
• 60 minutes
Instructions
1. Build the s-control
a. Click Setup | Develop | Custom S-Controls
b. Click New Custom S-Control
i. Label: SalaryControl
ii. Name: SalaryControl
iii. Type: URL
iv. .NET Content URL:
http://localhost/SalaryIntegratedControl/validate.aspx?sessionId=
{!API.Session_ID}&serverURL={!API.Enterprise_Server_URL_90}&
posId={!Position__c.Id}&userId={!$User.Id}
v. Java Content URL:
http://localhost:8080/SalaryIntegratedControl/validate.jsp?sessionId=
{!API.Session_ID}&serverURL={!API.Enterprise_Server_URL_90}&
posId={!Position__c.Id}&userId={!$User.Id}
Scenario:
• Universal Containers (UC) wants to publish the content for open positions
tracked in the Recruiting app on its corporate web site. UC IT wants to build a
solution that will allow the content creators (recruiters and hiring managers) to
manage publishing their own content easily and efficiently.
• UC would like candidates to apply for open positions through their web site and
have the data immediately fed into the Recruiting application.
Time:
• 60 minutes
Instructions
1. Choose your development language: Java, VB.NET, or C#.NET
2. Prepare your environment similarly to the last lab by copying over the application
into the web server folder
3. Change the username and password used in the configuration file located at
the following locations
a. Java: recruitingWeb\config.properties (Note: Do this using
Windows Explorer and a text editor outside of Eclipse)
b. .Net: recruitingWeb\web.config
4. Complete the code blocks in the Client file to implement the executeSOQL()
method using query and queryMore calls
a. Java: To test, you will need to start Tomcat using the shortcuts provided on
the desktop and use a browser to point to the URL:
http://localhost:8080/recruitingWeb/index.jsp
Scenario:
• Universal Containers has developed a fully functioning Recruiting application in
their Sandbox Environment. All testing has been performed and the IT staff is
ready to deploy the new app to their production environment.
• Package up the Recruiting application, upload it to the AppExchange Directory,
and register it to obtain the private URL.
Time:
• 5 minutes
Instructions
1. Click Setup | Create | Packages
2. Click New
3. Create an AppExchange Package
a. Package Name: Recruiting App
b. Description: enter a brief description
c. Click Save
4. In the Package Items related list, click Add
a. Select the Recruiting custom application
b. Click Add To Package
5. Under the Package Detail section, click Upload
a. Version Number: 1.0
b. Description: enter a brief description
c. Security: No password
d. There are no requirements for this package, so click Continue
e. Click Upload to AppExchange
Review
1. Is it possible to uninstall an application as well? What would this remove?
________________________________________________________________
________________________________________________________________
2. What happens if some of the objects that you are trying to install already exist in
the org?
________________________________________________________________
________________________________________________________________
________________________________________________________________
________________________________________________________________
Scenario:
• Universal Containers (UC) wants to start using Apex. To prepare their
environment, they will need to install the Force.com Toolkit plugin for Eclipse.
• It is assumed that the Java SDK 1.5 and Eclipse 3.3 for Java Developers or later
have already been installed on the client workstation. Note that these version
numbers are important.
• If the toolkit is already installed, verify that it is pointing to the correct remote site
URL and that it has been updated.
• Note that these instructions are also available on the ADN.
Time:
• 5 minutes
Instructions
1. Double click the Eclipse.exe icon to launch Eclipse
2. Click Help | Software Updates | Find and Install…
a. Select Search for new features and click Next
3. In the Update sites to visit dialog box, check the box at the bottom to
Automatically select mirrors
4. Click New Remote Site…
a. Name: Force.com Toolkit
b. URL: http://www.adnsandbox.com/eclipsetoolkit/release
c. Click OK
5. Click Finish and Eclipse will search the selected sites for the required plugins
6. In the Updates dialog box, select Force.com Toolkit
7. Click Select Required which should select the WSP tools from Europa and look
like the image below when expanded
Review
1. Do you have to use the Eclipse plugin for Apex development? Is there another
option? What might affect your decision?
________________________________________________________________
________________________________________________________________
Scenario:
• Universal Containers (UC) needs to use Apex to meet several requirements. To
get their environment ready, they will need to prepare a project workspace within
Eclipse.
• Note: You must have logged into your org at least once on your computer before
you are able to create and synchronize a project in the toolkit.
Time:
• 5 minutes
Instructions
1. Double-click the Eclipse executable to launch Eclipse
2. Select File | New | Force.com Project…
3. Enter the following information on the Force.com Project dialog box:
a. Project name: Enter your username as the project name
b. Username: Enter your Salesforce username for this course
c. Password: Enter your Salesforce password for this course
d. Namespace prefix: leave blank
e. SOAP endpoint: default
f. Click Finish
4. Right-click the newly created project in the left-hand navigation pane and select
Properties.
5. In the Properties dialog box, navigate to Force.com | Apex Code, set the
Logging Level slider all the way to the right to select Profiling (maximum
verbosity), and click OK.
Review
2. When would you need to create an Force.com Project for a specific namespace?
________________________________________________________________
________________________________________________________________
Scenario:
• Universal Containers wants to make sure they know the basics to create Apex
classes and triggers before they start tackling more ambitious objectives.
Tradition states that this introduction to a new programming language should be
a “Hello World” example.
Time:
• 10 minutes
Instructions
1. Login to your org and navigate to Setup | Create | Objects | Position | Custom
Fields and Relationships | New
2. Select a field Type of Text and click Next
3. Enter a Name and Label of Hello and a Length of 10
4. Click Next, Next and Save to accept the access and page layout defaults
5. In Eclipse, under your project folder | src | unpackaged, right-click the
unpackaged folder and select Force.com | New Apex Class
6. Enter the Name HelloWorldPositionClass and click Finish
7. Copy the code from the appropriate file in the Exercises folder, paste it into
Eclipse, and complete the ***TODO:…*** sections as required
8. In Eclipse, under your project folder | src | unpackaged, right-click the
unpackaged folder and select Force.com | New Apex Trigger
9. Enter the following information:
a. Name: HelloWorldPositionTrigger
b. Trigger Object: Position__c
c. Trigger Operations: Before Insert, Before Update
d. Click Finish
salesforce.com proprietary/confidential: customer internal use only
©2000-2007
- 53 -
10. Copy the code from the appropriate file in the Exercises folder, paste it into
Eclipse, and complete the ***TODO:…*** sections as required
11. Log in to your org and save a new position to verify that the Hello field populates
with the value World
Review
1. Can this code handle bulk updates? When would that be necessary?
________________________________________________________________
________________________________________________________________
Scenario:
• Previously, Universal Containers simply denied the ability to delete positions to
all employees, but recruiters are now asking for a way to delete positions if they
have no applicants. Company policy requires the retention of positions where
there were candidates who applied for the job.
Time:
• 10 minutes
Instructions
1. In Eclipse, under your project folder | src | unpackaged, right-click the
unpackaged folder and select Force.com | New Apex Trigger
2. Enter the following information:
a. Name: PositionDeleteTrigger
b. Trigger Object: Position__c
c. Trigger Operations: Before Delete
d. Click Finish
3. Copy the code from the appropriate file in the Exercises folder, paste it into
Eclipse, and complete the ***TODO:…*** sections as required
4. Log in to your org and try to delete a position that is already associated with a job
application to verify that the trigger throws an error message
Review
1. Could this code have been written to invoke a class instead of putting the work in
the trigger itself? Why was the decision made to do it this way?
Scenario:
• Universal Containers (UC) wants to complete their sharing model by making
relevant recruiting records available to the appropriate hiring managers as well
as just the recruiters.
Time:
• 15 minutes
Instructions
1. In Eclipse, under your project folder | src | unpackaged, right-click the
unpackaged folder and select Force.com | New Apex Trigger
2. Enter the following information:
a. Name: PositionSharingTrigger
b. Trigger Object: Position__c
c. Trigger Operations: After Insert, After Update
d. Click Finish
3. Copy the code from the appropriate file in the Exercises folder, paste it into
Eclipse, and complete the ***TODO:…*** sections as required
4. In Eclipse, under your project folder | src | unpackaged, right-click the
unpackaged folder and select Force.com | New Apex Class
5. Enter the Name PositionSharingClass and click Finish
6. Copy the code from the appropriate file in the Exercises folder, paste it into
Eclipse, and complete the ***TODO:…*** sections as required
7. Log into your org and create a new position, setting the Hiring Manager to the
other user in the org
Review
1. Why is the sharing done in two distinct steps with the two separate methods?
________________________________________________________________
________________________________________________________________
2. What might be an issue with creating a lot of automatic sharing Apex triggers?
________________________________________________________________
________________________________________________________________
Scenario:
• Before Universal Containers can deploy their code, they will need to ensure that
all triggers and at least 75% of all code lines have unit test coverage. They will
need to write unit test for all of their code, but here we will specifically only look at
one example.
Time:
• 15 minutes
Instructions
1. In Eclipse, under your project folder | src | unpackaged, right-click the
unpackaged folder and select Force.com | New Apex Class
a. Enter the Name HelloWorldPositionClassTest and click Finish
2. Copy the code from the appropriate file in the Exercises folder, paste it into
Eclipse, and complete the ***TODO:…*** sections as required
3. Once the code is saved and compiled, right-click your project folder | src |
unpackaged | classes folder and select Force.com | Run Tests and examine
the results in the log pane
Review
1. What keyword must all unit tests have?
________________________________________________________________
________________________________________________________________
2. A Salesforce administrator is concerned that unit tests will add junk data to the
Salesforce org database. What should you tell them?
________________________________________________________________
________________________________________________________________
Scenario:
• Universal Containers has completed their development phase and wants to move
the code created from a development environment into production using the
Eclipse Force.com Toolkit plugin.
Time:
• 10 minutes
Instructions
1. In Eclipse, right-click your project folder, and select Force.com | Deploy to
Server…
2. On the Destination Details dialog box, enter the following information:
a. Username: Enter the username for the destination org
b. Password: Enter the password for the destination org
c. SOAP Endpoint:
https://www.salesforce.com/services/Soap/u/11.1
d. Click Next
3. In the Archive Options dialog box, check the boxes create archive snapshots of
the project and/or the destination org locally, then click Next
4. In the Deployment Plan dialog box, select the classes and triggers that you wish
to deploy and click Next (Note: You can click the Validate Deployment button to
check that your items are valid)
5. Verify the details on the Pre-Deployment Review dialog box and click Next
6. Examine the Deployment Result dialog box and click Finish
Review
1. What are the requirements for deploying into a production environment?
Scenario:
• Universal Containers is having problems with duplicate records for candidates
entering the database. They have determined that the combination of a
candidate’s last name and email address are enough to ensure uniqueness
within the system.
Time:
• 15 minutes
Instructions
1. In your org, navigate to Setup | Create | Objects | Candidate | Custom Fields
and Relationships | New
2. Select a field Type of Formula Field and click Next
3. Enter a Label of Unique Key which defaults the Name to Unique_Key
4. Copy and paste the contents of the
CandidateUniqueKeyFormulaField.txt file into the formula text area in
the UI
5. Click Next, Next and Save to accept the access and page layout defaults
6. In Eclipse, under your project folder | src | unpackaged, right-click the
unpackaged folder and select Force.com | New Apex Class
7. Enter the Name CandidateKeyClass and click Finish
8. Copy the code from the appropriate file in the Exercises folder, paste it into
Eclipse, and complete the ***TODO:…*** sections as required
9. In Eclipse, under your project folder | src | unpackaged, right-click the
unpackaged folder and select Force.com | New Apex Trigger
10. Enter the following information:
a. Name: CandidateKeyTrigger
Review
1. What is the purpose behind the formula field? Why not just make it text?
________________________________________________________________
________________________________________________________________
Scenario:
• Universal Containers has a web tab that they use for employees to refer
candidates into the Recruiting application. In order to expose the previous
functionality, the previous code will need to be made into a Web Service.
• Note that although the referral form is being hosted in an s-control for this
exercise, it could just as well be an external web application.
Time:
• 15 minutes
Instructions
1. In Eclipse, under your project folder | src | unpackaged, right-click the
unpackaged folder and select Force.com | New Apex Class
a. Enter the Name CandidateKeyWebServiceClass and click Finish.
2. Copy the code from the appropriate file in the Exercises folder, paste it into
Eclipse, and complete the ***TODO:…*** sections as required
3. In the Salesforce UI, click Setup | Develop | S-Controls | New Custom S-
Control
a. Label: EmployeeReferral
b. S-Control Name: EmployeeReferral
c. Type: HTML
d. Copy and paste the content from the
CandidateKeyWebServiceClassSControl.txt file
e. Click Save
4. In the Salesforce UI, click Setup | Create | Tabs
5. In the Web Tabs section, click New
Review
1. What keywords do methods exposed as Web Services require?
________________________________________________________________
________________________________________________________________
2. Which access modifier must be used with Web Service methods and classes?
________________________________________________________________
________________________________________________________________