NM Lease Management 1
NM Lease Management 1
TECHNOLOGY
(An Autonomous Institution)
Thadagam Main Rd,
Coimbatore,
Tamil Nadu-641013
www.gct.ac.in
DEPARTMENT OF INFORMATION
TECHNOLOGY
BACHELOR OF TECHNOLOGY
2024 – 2025
SEVENTH SEMESTER
LEASE MANAGEMENT
TEAM MEMBERS:
S.Arunkumar - 71772118L02
V.Saravanakumar - 71772118L08
GOVERNMENT COLLEGE OF
TECHNOLOGY
(An Autonomous Institution)
Thadagam Main Rd,
Coimbatore -641013
www.gct.ac.in
DEPARTMENT OF INFORMATION
TECHNOLOGY
Name : Arunkumar.S
NM ID : E6D14677ACF422392A84F61B316D533B
____________________________________ ___________________________________
1. Project Overview:
This project focuses on Lease Management, designed to address the challenge of
efficiently managing lease agreements, tracking compliance, and automating key processes. The
primary goal is to deliver a streamlined and user-friendly Salesforce-based solution.
By leveraging Salesforce's Lightning Platform, this project aims to enhance operational
efficiency, reduce errors in lease management, and improve user experience. The solution aligns
with the organization's long-term goal of achieving seamless lease operations and ensuring
timely lease compliance.
2. Objectives:
Business Goals
1. Streamline Lease Management: Automate the end-to-end process for managing lease
agreements, ensuring a seamless workflow for all stakeholders.
2. Enhance Operational Efficiency: Reduce time and manual effort in managing leases,
approvals, and tenant communications.
3. Ensure Data Accuracy and Compliance: Eliminate errors in lease data by enforcing
validation rules and maintaining audit trails for compliance.
4. Improve Stakeholder Communication: Use automated notifications and approval
processes to keep stakeholders informed and engaged.
5. Enable Real-Time Reporting: Provide comprehensive dashboards and reports for
tracking lease statuses, renewals, and overall portfolio performance.
Specific Outcomes
1. Custom Salesforce Objects:
o Define objects for Leases, Properties, and Tenants to store all relevant
information.
2. Automated Workflows:
o Build Flows to handle lease renewals, reminders, and escalations without manual
intervention.
3. Validation Rules and Business Logic:
o Enforce rules such as checking lease dates and ensuring unique entries for each
lease agreement.
4. Approval Processes:
o Implement a multi-level approval process involving property managers and legal
teams to streamline decision-making.
5. Dynamic Email Templates:
o Create templates for lease expiration reminders, renewal offers, and approval
notifications.
6. Dashboard and Reporting:
o Provide interactive dashboards to track key metrics, including the number of
active leases, upcoming expirations, and approval statuses.
7. Code and Integration Enhancements:
o Develop Apex triggers for custom logic and Schedule Classes for time-based
automations, ensuring smooth operations at scale.
1. Custom Objects
• Leases: Tracks information like Lease ID, Start Date, End Date, Monthly Rent, and
Renewal Status.
• Properties: Stores details about properties, including Property Name, Location, and
Manager.
• Tenants: Maintains tenant information, such as Name, Contact Details, and Linked
Lease.
2. Tabs
• Custom tabs for Leases, Properties, and Tenants allow users to quickly access and
manage relevant data.
• Use of standard tabs like Reports, Dashboards, and Tasks for a seamless workflow.
5. Email Templates
• Dynamic email templates to:
o Notify tenants of upcoming lease expirations.
o Alert property managers when a new lease is pending approval.
o Send confirmation emails after lease approvals.
6. Approval Process
• Multi-level approval workflow involving:
o Initial approval by the property manager.
o Final approval by the legal department.
• Automated notifications for pending and approved steps.
7. Flows
• Screen Flows: Interactive forms for creating and updating lease records.
• Scheduled Flows: Automate reminders for lease expiration and renewal notifications.
• Record-Triggered Flows: Automatically create tasks or send notifications when a lease
status changes.
8. Apex Triggers
• Custom triggers to:
o Automatically update the Renewal Status field based on lease dates.
o Prevent the deletion of leases tied to active tenants.
o Calculate penalties for late renewals.
9. Schedule Class
• A Schedule Class automates periodic tasks, such as:
o Sending lease expiration reminders.
o Generating monthly performance reports.
4.Detailed Steps to Solution Design:
2. Creating objects:
1. Lease Object
Steps to Create
2. Property Object
Steps to Create
Relationships Setup
Tabs in Salesforce play a crucial role in providing a structured and user-friendly way to organize
and access data. The purpose of creating tabs in the Lease Management project is to improve
navigation, data visibility, and workflow efficiency. Here's a detailed look at the purpose behind
creating specific tabs for the project:
1. Lease Tab
Purpose:
• Centralized Management: This tab will serve as the primary location for managing lease
records, including lease start and end dates, renewal status, monthly rent, and tenant-property
associations.
• Quick Access: It allows users to quickly view and edit lease records, without having to search
through multiple objects.
• Efficient Filtering: Users can filter leases by status (e.g., Active, Pending Renewal, Expired) to
easily focus on relevant data.
• Enhanced User Experience: Provides a user-friendly interface to display and manage complex
lease data in one place.
Benefits:
Purpose:
Benefits:
3. Property Tab
Purpose:
Benefits:
The Lease Management Lightning App provides an intuitive interface for managing leases,
tenants, and properties.
Steps to Create the App
1. Go to Setup → App Manager → New Lightning App.
2. App Settings:
o App Name: Lease Management
o Navigation Style: Standard Navigation
o App Options:
▪ Assign a custom logo.
▪ Enable app personalization for users.
Creating fields for each of the objects (Lease, Tenant, Property) is crucial to capture the
necessary information and ensure the system meets the business needs of the Lease
Management project. Below are the steps and detailed field creation for each object:
Fields to Create:
Field Name Data Type Description
Lease ID Auto-Number Automatically generates a unique ID for each lease.
Start Date Date The date the lease starts.
End Date Date The date the lease ends.
Monthly Rent Currency The monthly rent amount for the lease.
Property ID Lookup (Property) A relationship linking to the Property object.
Tenant ID Lookup (Tenant) A relationship linking to the Tenant object.
Status of the lease (Active, Pending Renewal,
Renewal Status Picklist
Terminated).
Formula
Lease Term Formula: End Date - Start Date (calculated lease term).
(Number)
Lease
Text Area Optional field for any additional notes or terms.
Description
Field Type Details:
• Auto-Number: Automatically generates a unique identifier, e.g., "L-0001."
• Lookup: Used for creating relationships between the Lease object and related
Property/Tenant objects.
• Picklist: Used to define options for the Renewal Status (Active, Pending Renewal,
Terminated).
• Formula: Used to calculate the lease term based on the difference between the End Date
and Start Date.
Fields to Create:
Field Name Data Type Description
Tenant Name Text Name of the tenant.
Contact Email Email Email address of the tenant.
Contact Phone Phone Phone number of the tenant.
Lease ID Lookup (Lease) Links the tenant to a specific lease.
Tenant Type Picklist Type of tenant (Individual, Company, etc.).
Date of Birth Date Date of birth for individual tenants.
Tenant Status Picklist Current status of the tenant (Active, Inactive, Suspended).
Fields to Create:
Field Name Data Type Description
Property Name Text Name or title of the property.
Address Text Area Full address of the property.
Property
Lookup (User) Relationship linking to the Property Manager (User object).
Manager
Number of Units Number Number of units available at the property.
Status of the property (Available, Under Maintenance,
Property Status Picklist
etc.).
The date when the first lease agreement begins at the
Lease Start Date Date
property.
Lease Expiry
Date The date when the last lease at the property expires.
Date
Total Active Roll-Up A summary field that counts all active leases related to the
Leases Summary property.
Field Type Details:
You can set Validation Rules to ensure data integrity. For instance:
plaintext
Copy code
End_Date c <= Start_Date c
4. Error Message: "End Date must be after Start Date."
4.1Validation Rules:
1. End Date Validation
• Formula:
plaintext
Copy code
End_Date c > Start_Date c
• Formula:
plaintext
Copy code
Monthly_Rent c > 0
5. Approval Process
Steps to Create
Email Notifications
• Purpose: Notify tenants about lease expiration and automate renewal reminders.
• Steps:
o Create a Flow with the trigger set to run daily.
o Query leases expiring in the next 30 days.
o Send an email notification using dynamic templates.
2. Screen Flows
3. Record-Triggered Flows
7.Apex Triggers:
In Salesforce, Apex Triggers are used to execute custom logic before or after specific actions
occur on records (e.g., Insert, Update, Delete). Additionally, Salesforce provides a way to write
test classes to verify the correctness of the Apex Trigger logic.
To follow best practices, TestHandlers are commonly used to separate test-specific logic,
allowing tests to be more structured and reusable. Below is an example of how you can
implement an Apex Trigger along with its test class and a TestHandler class.
Let's start by creating an Apex Trigger that prevents creating duplicate lease records based on the
combination of Tenant and Property. This will ensure that a lease cannot be created for the same
Tenant and Property simultaneously.
Trigger: Prevent Duplicate Lease Entries
trigger PreventDuplicateLeases on Lease c (before insert) {
// Collect the Tenant ID and Property ID to check for duplicates
Set<String> tenantPropertyKeys = new Set<String>();
for (Lease c lease : Trigger.new) {
tenantPropertyKeys.add(lease.Tenant_ID c + '-' + lease.Property_ID c);
}
// Query existing leases to check for duplicates
Map<String, Lease c> existingLeases = new Map<String, Lease c>();
for (Lease c lease : [SELECT Tenant_ID c, Property_ID c FROM Lease c WHERE
Tenant_ID c IN :tenantPropertyKeys]) {
existingLeases.put(lease.Tenant_ID c + '-' + lease.Property_ID c, lease);
}
@isTest
static void testPreventDuplicateLeases() {
// Create test Property and Tenant records
Property c property = new Property c(Name = 'Property 1', Address = '123 Test St');
insert property;
Test.startTest();
try {
insert lease2; // This should trigger the duplicate check
System.assert(false, 'Expected an exception due to duplicate lease.');
} catch (DmlException e) {
// Ensure the error message is correct
System.assert(e.getMessage().contains('A lease already exists for this tenant and
property.'));
}
Test.stopTest();
}
}
insert leases;
return leases;
}
return lease;
}
for (Integer i = 0; i < 12; i++) { // Example: Create payments for the next 12 months
Payment c payment = new Payment c(
Lease c = lease.Id,
Payment_Date c = currentMonth,
Amount c = lease.Monthly_Rent c
);
payments.add(payment);
currentMonth = currentMonth.addMonths(1);
}
insert payments;
return payments;
}
}
9.Create an Apex Class
1. To create a new Apex Class follow the below steps:
Click on the file >> New >> Apex Class.
2. Enter class name as MonthlyEmailScheduler.
Apex logic:
global class MonthlyEmailScheduler implements Schedulable {
global void execute(SchedulableContext sc) {
Integer currentDay = Date.today().day();
if (currentDay == 1) {
sendMonthlyEmails();
}
}
Messaging.sendEmail(new Messaging.SingleEmailMessage[]{email});
}
}
}
• Make an approval
6. Key Scenarios Addressed by Salesforce in the Implementation
Project:
• Automating approval processes to reduce delays.
• Providing real-time reporting for all lease-related activities.
• Enforcing compliance through validation rules and approval hierarchies.
• Ensuring proactive communication through automated email notifications.
7. Conclusion:
Summary of Achievements