Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
78 views17 pages

Programming Assignment Scenario - ABC Real Estate

Uploaded by

rahul.dange733
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
78 views17 pages

Programming Assignment Scenario - ABC Real Estate

Uploaded by

rahul.dange733
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

Salesforce University

   

Salesforce  Certification  
Programming  Assignment  
Winter  ’16  
 
 

    1  
Salesforce  Certification  Programming  Assignment
 

Contents  
PROGRAMMING  ASSIGNMENT  INSTRUCTIONS  ..................................................................................................  3  
SALESFORCE  ORGANIZATION  SPECIFICATIONS  .....................................................................................................  3  
HOW  TO  SUBMIT  YOUR  PROGRAMMING  ASSIGNMENT  ..................................................................................  3  
SCORING  .......................................................................................................................................................................  4  
GENERAL  REQUIREMENTS  ........................................................................................................................................  4  
COMPANY  OVERVIEW  ...............................................................................................................................................  5  
PROJECT  OVERVIEW  ...................................................................................................................................................  5  
DATA  MODEL  OVERVIEW  ..........................................................................................................................................  5  
ACCESS  AND  PERMISSIONS  OVERVIEW  .................................................................................................................  9  
LOGIC  REQUIREMENTS  ............................................................................................................................................  10  
USER  INTERFACE  REQUIREMENTS  .........................................................................................................................  11  
TESTING  REQUIREMENTS  ........................................................................................................................................  17  

DO  NOT  DISTRIBUTE  –  FOR  USE  BY  CERTIFICATION  CANDIDATE  ONLY   2  


Salesforce  Certification  Programming  Assignment

Programming  Assignment  Instructions  


The Salesforce Certification Programming Assignment asks each candidate to develop a working
application using the capabilities of the Force.com platform. Each application should meet the identified
business and technical requirements outlined in this document.
The final application should be developed in a Force.com sandbox and deployed to the production
organization provided. Candidates should consider this application to be a working prototype rather than a
market-ready application. To minimize development time, the requirements are intentionally limited in
scope. Potential features and capabilities that would make a market-ready application are intentionally
excluded from the assignment requirements. Only the requirements described in this document are
mandatory, and candidates should not spend time building features or capabilities that are not explicitly
stated. For example, the user interface is scored on technical completeness, not on visual aesthetics.
All assignments must be received and short essay exams completed by Wednesday, December 30 at 9:00
a.m. Pacific Time (GMT -8:00) (US and Canada). No exceptions will be made.

Salesforce  Organization  Specifications  


Each candidate has been provided a Salesforce organization with the following specifications:

! An Enterprise Edition organization with 20 active licenses, 5 of which are reserved for judges. Do not
activate the judge users or use them for any other purpose.

! One developer sandbox with a single refresh allowed.


Candidates must never submit a request to activate inactive features that require provisioning by Salesforce,
such as person accounts, multi-currency, or the translation workbench.
The application should be developed based on generally available functionality, and should not include
pilot, limited release, or developer preview features.
Candidates should factor in Salesforce regular maintenance and release schedules.

How  to  Submit  Your  Programming  Assignment    


The final application will be evaluated and scored in the production organization provided. In order for the
application to be accepted for evaluation, candidates must complete the following steps:

! Develop the application in a Force.com sandbox and deploy to the production organization provided.

! In the production organization, locate the user named Certification Administrator, activate and
update the user’s email address to [email protected], ensuring that the Generate new
password and notify user immediately checkbox is checked.
Once submitted, the application is considered to be final. Salesforce will receive login credentials for the
user, enabling the Certification Administrator to access the organization. Upon confirmation of the
Certification Administrator user activation, Salesforce will deactivate the candidate’s user.
For questions related to the submission process, open a case with the Certification team:
http://certification.salesforce.com/open-a-case.
Please note: All assignments must be received and short essay exams completed by Wednesday,
December 30 at 9:00 a.m. Pacific Time (GMT -8:00) (US and Canada). No exceptions will be made.
 

DO  NOT  DISTRIBUTE  –  FOR  USE  BY  CERTIFICATION  CANDIDATE  ONLY   3  


Salesforce  Certification  Programming  Assignment

Scoring  
Once a candidate’s Programming Assignment and essay exam have been received, the work submitted will
be reviewed and scored by a panel of qualified Salesforce experts.
Each candidate will be evaluated on the decisions made when designing the programmatic elements of the
application, which include:

! Appropriate use of native functionality.

! Effective use of object-oriented design patterns.

! Efficiency and elegance of programmatic design.


Exam results will be distributed to each candidate by email, and will include feedback designed to highlight
the candidate’s strengths and areas for improvement.

General  Requirements  
Each candidate is expected to comply with the following general requirements for application development:

! The application must be the original work of the candidate. Candidates may explore best practices and
patterns found in online resources, but may not include code copied directly from other sources,
including public libraries.

! All application development must be done in a sandbox environment and fully deployed to and tested
in the production environment.

! Each candidate will need to create his or her own sample data set to support application development
and manual testing in both the sandbox and production organizations.

! The application must scale for large data and user volumes, as stated in the requirements within this
document. However, it is not necessary to load the data volumes stated; a sample data set is sufficient.

! The application must handle programmatic exceptions gracefully. Any end-user errors or exceptions
should be presented in a user-friendly format.

! The user interface must be functional and meet the stated requirements, but time should not be spent
creating an elaborate user interface as aesthetics will not be evaluated. The user interface should match
the flow and structure of the wireframes provided.

! Comments within code are highly recommended, as they may be useful to help judges better
understand the function of the code developed during the evaluation process.

! Do not include any personally identifiable data in the organization or code comments, with the
exception of your email address on user records.

! All requirements must be addressed in the final application submitted for evaluation and scoring. No
extra credit is given for going beyond the identified requirements.
 

DO  NOT  DISTRIBUTE  –  FOR  USE  BY  CERTIFICATION  CANDIDATE  ONLY   4  


Salesforce  Certification  Programming  Assignment

Company  Overview  
ABC Real Estate (ABC) is an up-and-coming real estate firm. The company was started by three original
agents (Arnold, Betty, and Charlie) but has now expanded to dozens of full-time agents in several regional
offices.
The agents working for ABC are paid a commission earned on the buying and selling of properties.
Tracking the amount of commission earned by each agent has been a completely manual process, and has
become increasingly difficult as the company expands.

Project  Overview  
ABC continues to grow, but the original IT infrastructure has not scaled to meet the demands of the
expanding company. In a recent decision, the founders of the company chose the Force.com platform to
bring its business into the cloud.
The process to review closed sales and calculate agents’ commission splits has become a lengthy and time-
consuming task. ABC would like the system to automate the calculation and tracking of agent
commissions. A Salesforce Certified Platform App Builder has built their data and security model. Now,
ABC Real Estate requires a Salesforce Certified Advanced Developer or a Salesforce Certified Platform
Developer II to build their update logic and custom user interfaces.
This document outlines the current state of the application and the remaining requirements the candidate
will need to fulfill. It should be assumed by the candidate that no significant declarative configuration
changes are necessary to fulfill the requirements; only code development and very minimal configuration
of a mechanism to invoke the code will be required.

Data  Model  Overview  


This section of the document details the data model of the application, for the candidate’s reference. The
data model has already been configured in the Salesforce organization provided.
Candidates should not need to modify the data model or the lookup or master-detail relationships between
objects, and should assume that the data model is a design constraint.

Entity  Relationship  Diagram  


Below is the Entity Relationship Diagram (ERD) of the application being developed. The ERD depicts all
of the objects that play a significant role and are needed to understand the application requirements.

DO  NOT  DISTRIBUTE  –  FOR  USE  BY  CERTIFICATION  CANDIDATE  ONLY   5  


Salesforce  Certification  Programming  Assignment

DO  NOT  DISTRIBUTE  –  FOR  USE  BY  CERTIFICATION  CANDIDATE  ONLY   6  


Salesforce  Certification  Programming  Assignment

Data  Requirements  
User
Currently, all Agents are full Salesforce Users. In the future, ABC will create a Salesforce Community.
When that happens, Agents will be transitioned away from full Salesforce Users. For this project, an Agent
will have both a Contact record and a User record. All DML should be performed on the Agent’s
Contact record.

Contact: Public Read/Write Sharing Model.


Contacts represent the Real Estate Agents working for ABC. Future expansions will include rolling out
multiple Record Types and a Salesforce Community Cloud. However, this is outside the scope of the
current project.
NOTE: There are several fields that track year-to-date amounts. These will be updated to “0” during the
normal end-of-year process by ABC. There is no need to build a process to clear out these fields at the
beginning of the current year.
Key Fields:

! Agent User: Salesforce User record for this agent. Lookup field (User).
Note: The ABC Salesforce Administrator has made this a required field on the Contact page layout.

! Account: The Salesforce account (e.g., “ABC Real Estate”) to which the Contact is associated.
Note: The ABC Salesforce Administrator has made this a required field on the Contact page layout.

! Sales Office: Sales Office where this agent works. Lookup field (Sales_Office__c).
Note: The ABC Salesforce Administrator has made this a required field on the Contact page layout.

! Year to Date Total Commissions: The total amount of commissions earned by this Agent during the
current year. Currency field.

! Year to Date Total Sales: The total amount of sales closed by the Agent during the current year.
Currency field.

! Default Commission Split: The default commission percentage earned by the Agent each time a
Property is closed. Default value is 40%. Percentage field.

Property (Property__c): Public Read/Write Sharing Model.


Properties represent the actual real estate property being bought and sold. Each Property has an assigned
Agent and an assigned Sales Office that tracks it. This project will only concern itself with commissions
earned on selling properties. A future project will handle the complexity of splitting commissions when
buying properties.
Key Fields:

! Agent: Agent who handles this Property. Lookup field (Contact).

! Agent Commission Amount: Holds the amount of commission to be paid to the agent. NOTE: This
cannot be a formula, since the flat commission rate (currently 3%) can change, and would therefore
affect previously closed Properties. Currency field.

DO  NOT  DISTRIBUTE  –  FOR  USE  BY  CERTIFICATION  CANDIDATE  ONLY   7  


Salesforce  Certification  Programming  Assignment

! Agent Commission Percentage: The percentage of the total commission received by the agent. When
an agent first claims a property, this should equal the percentage in the Default Commission Split on
the agent’s Contact record. Percentage field.
NOTE: ABC Real Estate plans future enhancements involving commission percentages, and has
expressed concerns about Order of Operation conflicts with planned custom code. For this reason, do
not populate Agent Commission Percentage via Workflow.

! Sale Date: The date the property was closed. Date field.
NOTE: The ABC Salesforce Administrator has created a workflow rule to populate the Sale Date (if
blank) when a property has closed.

! Sales Price: The actual sales price of the property. Currency field.
NOTE: The ABC Salesforce Administrator has configured a Workflow rule to populate the Sales Price
(if blank) with the Listing Price when a property has closed.

! Sales Office: Sales Office that handles this Property. Lookup field (Sales_Office__c).

! Status: The status of the Property. Picklist field.


Note: The ABC Salesforce Administrator has configured a validation rule to prevent Agents from
setting the Status to “Closed Approved.” The Status field has the following values:
• Open
• Working
• Closed Pending Approval
• Closed Approved
• Withdrawn

Sales Office (Sales_Office__c): Controlled by Parent.


These are the local branch offices of ABC.
NOTE: There are several fields that track year-to-date amounts. These will be updated to “0” during the
normal end-of-year process by ABC. There is no need to build a process to clear out these fields at the
beginning of the current year.
Key Fields:

! Year to Date Sales: The total amount of sales by agents assigned to this sales office during the current
year. Currency field.

! Sales Region: Sales Region to which this office is assigned. The sales office is a child record in a
Master/Detail relationship to Sales Region. Master/Detail field (Sales_Region__c).

Sales Region (Sales_Region__c): Public Read/Write Sharing Model.


These are organizational units run by a Regional Manager. Each region will have one or more local Sales
Offices.
Key Fields:

! Regional Manager: Salesforce User who runs an office. Lookup field (User).

DO  NOT  DISTRIBUTE  –  FOR  USE  BY  CERTIFICATION  CANDIDATE  ONLY   8  


Salesforce  Certification  Programming  Assignment

Data  Volumes  
The application must scale to handle the following data volumes:

! Sales Regions: Dozens

! Sales Offices: Dozens

! Agents: Hundreds

! Open Properties in a Sales Region: 1,000s

Access  and  Permissions  Overview  


This section of the document details the access and permissions for the application, provided for the
candidate’s reference.
To facilitate the visibility requirements of the application, the organization-wide defaults (OWD), the role
hierarchy, and the field-level security settings have already been configured in the Salesforce organization
where applicable.
Candidates should not need to modify the OWD, role hierarchy, or field-level security for this application.

Application  Users  
There are two primary user groups for the application:
Agents are Real Estate Agents who work with clients to buy and sell properties. They are paid a percentage
of the commission earned on properties. The remainder of the commission is kept by the sales office.
Sales Managers are ABC employees who manage a sales region. They review all closed properties and
perform a final approval of the commission split.

Profiles  
Profiles with the appropriate visibility and CRUD (create, read, update, delete) settings have already been
configured in the Salesforce organization provided.
Candidates should not need to modify profiles except to add/remove Visualforce Page and/or Apex Class
access as the candidate deems necessary.
 

DO  NOT  DISTRIBUTE  –  FOR  USE  BY  CERTIFICATION  CANDIDATE  ONLY   9  


Salesforce  Certification  Programming  Assignment

Logic  Requirements  
This section of the document details the automation that the candidate is required to implement
programmatically.

Claiming and Closing Properties


Any new, unassigned property listed with a sales office may be claimed by an agent. However, an agent
can have only 5 open properties at any time (defined as Property__c.Status__c = “Working” saved in the
database). When a property is claimed Property__c.Agent_Commission_Percentage__c should be updated
with the default amount from the agent’s Contact record (Contact.Default_Commission_Split__c).
When Property__c.Status__c is set to “Closed Pending Approval” Property__c.Sales_Price__c should be
added to Contact.Year_To_Date_Total_Sales__c for the Agent’s Contact record.
Property__c.Sales_Price__c should also be added to Sales_Office__c.Year_To_Date_Sales__c of the
property’s sales office.
To determine whether a property should be included in the current year totals ABC uses
Property__c.Sale_Date__c.
Ideally, roll-up summary fields would be used to calculate totals. However, Properties are often created
without an Agent or Sales Office assigned, so therefore cannot exist in a Master/Detail relationship. DO
NOT change any fields to Master/Detail.

Approving Commissions
After an agent has sold the property and marked Property__c.Status__c as “Closed Pending Approval,” a
sales manager must review the property, optionally increase the commission percentage, and approve the
commission split for the agent. A property is considered approved when Property__c.Status__c is changed
to “Closed Approved.”
When approved, Property__c.Agent_Commission_Amount__c should be computed. Then
Property__c.Agent_Commission_Amount__c should then be added to
Contact.Year_to_Date_Total_Commissions__c on the agent’s Contact record.
NOTE: ABC currently charges their clients a flat 3% agency commission for all properties sold, but this
percentage may change in the future. The amount of commission earned by an agent would be the product
of multiplying Property__c.Sales_Price__c by the agency commission rate (3%), and then multiplying that
by Property__c.Agent_Commission_Percentage__c. Example:

! Sales Price: $100,000

! Agency Commission: 3%

! Agent Commission Split: 40%

! This would yield $1,200 in commission for the Agent (100000 * .03 * .40).
 

DO  NOT  DISTRIBUTE  –  FOR  USE  BY  CERTIFICATION  CANDIDATE  ONLY   10  


Salesforce  Certification  Programming  Assignment

When  to  Update  


Automated update logic requirements must handle all data changes made by ABC Employees using the
Claim Properties and Approve Commission screens.
In addition, there are times when a property must be updated outside of these screens due to travel
schedules of sales managers and agents. When these happen, an ABC System administrator must be able to
make bulk changes via a data loading tool. Updates can include closing properties for agents, overriding
commission splits, and approving properties. Occasionally, an administrator will need to delete and
undelete properties. The candidate is expected to handle these cases in their automated update logic.
In all cases, automated update logic must occur in real time. If any errors occur while performing
automated update logic, the candidate is expected to handle them so that data integrity is preserved.
 

User  Interface  Requirements  


This section of the document details user interface-driven functionality that candidates must implement
programmatically.
The following mock-ups attempt to portray the desired outcome of the user interface.
Note: The user interface has been simplified for the purpose of the Programming Assignment, and does not
necessarily include all of the elements that would be present in a fully functional interface. Pagination for
the new user interface (UI) is required, although the look and feel is up to the developer.

Claiming  and  Closing  Properties  


ABC would like Agents to have the ability to quickly claim multiple Properties. They need a screen that
will allow them access to all open properties for their assigned sales office. They should be able to select
multiple properties at a time and mark those selected as being “claimed.” They should also be able to
cancel out of the page. To prevent hoarding of properties, agents are not allowed to have more than 5
properties with a status of “Working” at any time.
Due to the competitive nature of the agency, it is possible for another agent to claim a property while the
current agent is working. If a property was claimed by another agent between the time the page was
rendered and the selected properties claimed, the property should not be saved. An error message should be
displayed if a property was claimed by someone else.

DO  NOT  DISTRIBUTE  –  FOR  USE  BY  CERTIFICATION  CANDIDATE  ONLY   11  


Salesforce  Certification  Programming  Assignment

Figure 1
As shown in Figure 1, the candidate must create a custom button on the Sales Office Page called “Claim
Properties.” This will launch the custom User Interface to claim properties by the agent.

Figure 2
As shown in Figure 2, when the page first loads, all Open properties should be displayed for the agent’s
sales office.
1) The name of the Sales Office should be displayed.
2) Only properties with a status of “Open” that are assigned to the agent’s sales office and NOT
claimed by an agent should be displayed.
3) Properties are sorted by Property Street.
4) The Properties should appear 5 rows at a time, and should display the current page number, the
total number of pages, and provide links to the first, last, next, and previous pages. Pagination
buttons/links should only appear if relevant (ex: “First” and “Previous” links should be omitted or
disabled from the first page of results).
5) Contact.Year_to_Date_Total_Sales__c and Contact.Year_to_Date_Total_Commissions__c should
be displayed.

DO  NOT  DISTRIBUTE  –  FOR  USE  BY  CERTIFICATION  CANDIDATE  ONLY   12  


Salesforce  Certification  Programming  Assignment

Figure 3
As shown in Figure 3, an agent can claim multiple properties at a time.
1) The agent should be able to select records on multiple pages, and have all records across all pages
saved at one time when either the “Claim Properties” or “Claim and Continue” buttons are clicked.
No changes should be committed when paginating.
2) Only selected rows will be saved.
3) The numbers for Properties Claimed, Contact.Year_to_Date_Total_Sales__c, and
Contact.Year_to_Date_Total_Commissions__c should always reflect the most current data saved
in the database.
4) As the agent selects properties, a counter should display the number of properties currently
selected across all pages.
5) Any time a property is claimed by clicking the “Claim Properties” or “Claim and Continue”
buttons:
a. Property__c.Status__c should be updated to “Working.”
b. Property__c.Agent__c field should be updated with the current user’s Agent (Contact)
record.
c. Property__c.Agent_Commission_Percentage__c should be updated with the default
percentage from the agent’s Contact record.
d. The numbers for Contact.Year_to_Date_Total_Sales__c and
Contact.Year_to_Date_Total_Commissions__c should be computed.
e. The numbers for Sales_Office__c.Year_to_Date_Sales__c should be computed.
6) If the agent clicks “Claim Properties,” the screen should return to the Sales Office.
7) If the agent clicks “Claim and Continue,” the screen should remain on the Claim Property screen
and the most current numbers should be displayed for Number of Properties Claimed, My Year to
Date Sales, and My Year to Date Commissions.

DO  NOT  DISTRIBUTE  –  FOR  USE  BY  CERTIFICATION  CANDIDATE  ONLY   13  


Salesforce  Certification  Programming  Assignment

8) No changes should be committed to the database if the total number of claimed properties is
greater than 5 (number of previously claimed properties + number of selected properties to be
claimed). An error message on the screen should notify the agent if this happens.
9) If an error prevents a successful save, including current validation rules, future validation rules,
and unexpected Apex exceptions, all committed changes should be rolled back.
10) Clicking the “Cancel” button will return to the Sales Office page, and will not commit changes to
the database.

Approving  Commissions  
ABC would like Sales Managers to have the ability to quickly approve multiple commissions. Sales
managers need a screen that will allow them access to all open properties for their assigned sales region.
They should be able to select multiple properties at a time, and mark all selected as being “approved.”
Sales managers should be able to increase the commission split for selected properties from this screen (the
commission may be increased as a performance incentive, to reward agents for repeat customers).
Managers should also be able to cancel out of the page. Agents should not be allowed to approve
commissions via this screen.

Figure 5
As shown in Figure 5, the candidate must create a custom button on the Sales Region Page called
“Approve Commissions.” This will launch the custom User Interface to approve the commission amount
and override the default commission. A Sales Manager should only be able to view properties for his or her
region.

DO  NOT  DISTRIBUTE  –  FOR  USE  BY  CERTIFICATION  CANDIDATE  ONLY   14  


Salesforce  Certification  Programming  Assignment

Figure 6
As show in Figure 6, when the page first loads, all properties that are “Closed Pending Approval” for the
sales region are displayed.
1) The name of the Sales Region should be displayed.
2) Only properties with a status of “Closed Pending Approval” and in the currently selected sales
region should be displayed.
3) Properties are sorted by Property__c.Sales_Office__c and then by Property__c.Agent__c.
4) The Agent Commission Percentage is populated with the value from the Property record.
5) The properties should appear 5 rows at a time, and should display the current page number, the
total number of pages, and provide links to the first, last, next, and previous pages. Pagination
buttons/links should only appear if relevant (ex: “First” and “Previous” links should be omitted or
disabled from the first page of results).
6) The numbers for Sales_Office__c.Year_to_Date_Sales__c should be displayed and should always
reflect the most current data saved in the database.

DO  NOT  DISTRIBUTE  –  FOR  USE  BY  CERTIFICATION  CANDIDATE  ONLY   15  


Salesforce  Certification  Programming  Assignment

Figure 7
As shown in Figure 7, a sales manager may select individual rows to approve.
1) The manager should be able to select records on multiple pages, and have all records across all
pages saved at one time when either the “Approve Commissions” or “Approve Commissions and
Continue” buttons are clicked. No changes should be committed when paginating.
2) For any selected row, the sales manager may override the default Agent Commission Percentage.
3) Only selected rows will be saved.
4) The manager may check the “Select All” checkbox to select every row on the current page.
5) When the manager clicks “Approve Commissions” or “Approve Commissions and Continue,” for
each selected property:
a. Property__c.Status__c will be updated to “Closed Approved.”
b. Property__c.Agent_Commission_Percentage__c will be saved. If the manager overrides
this field, the new value will be saved.
c. Property__c.Agent_Commission_Amount__c will be calculated on the property.
d. Contact.Year_to_Date_Total_Commissions__c will be computed on the agent’s Contact
record.
6) If the manager clicks “Approve Commissions,” the screen should return to the Sales Region.
7) If the manager clicks “Approve Commissions and Continue,” the screen should remain on the
Approve Commissions screen and the most current numbers should be displayed for Total Year to
Date Sales. The previously approved properties should not appear on the page.
8) If an error prevents a successful save, including current validation rules, future validation rules,
and unexpected Apex exceptions, all changes should be rolled back.
9) Clicking the “Cancel” button will return to the Sales Region page, and will not commit changes to
the database.

DO  NOT  DISTRIBUTE  –  FOR  USE  BY  CERTIFICATION  CANDIDATE  ONLY   16  


Salesforce  Certification  Programming  Assignment

Testing  Requirements  

Apex  Tests  
The candidate is responsible for writing Apex tests to validate the application behavior against business
requirements. The tests should assert that the automated logic and user interface function correctly, validate
application security, and ensure that the application scales for large data volumes. The application must
meet the code coverage requirements for deployment into a full production organization. Apex tests should
be written to be data- and organization-independent.

You might also like