Note
Movies & Books Management System Salesforce application was created as part of my engineering thesis. It is a simple application which presents the capabilities of the Salesforce CRM cloud platform. At the moment application allows you to manage books, movies, artists and so on.
Important
To deploy and run this application on your Salesforce Organization you have to:
- install git
- install Salesforce CLI
- create Hands-On Org (you need to have a Trailhead account) and get login credentials to the newly created org (it is the easiest way)
- clone this repo
git clone https://github.com/artysta/movies-and-books-management-system
- enter the project directory
cd movies-and-books-management-system
- authorize your org
sf org login web --alias mbms-app
- set org as a default one
sf config set target-org mbms-app
- start deployment
sf project deploy start
- (optional) start deployment & run tests
sf project deploy start --test-level RunLocalTests
Tip
You can run the below code in the Apex Anonymous Window to insert sample records to the database.
SampleDataFactory.createAndInsertSampleRecords();
Note
There are some post deployment steps you should take in order to make this application look and work as it should. Ofcourse these steps are not required, but I just suggest you to take them. Add Home Page to the app Navigation Bar:
- Click Personalize your nav bar (pen icon in the upper right corner on the navigation bar)
- Click Add More Items button
- Under Available Items click All
- Search for Home
- Click "Plus" button next to Home
- Click Add 1 Nav Item button
- Click Save button
Warning
Things that can be done to increase quality, performance and so on:
- Consider using SOQL For Loops to iterate and process data from large queries (Group is not so perfect for this one but it is just an example) to avoid Heap Size Limit Error.
e.g. instead of this:
List<Group> queues = [SELECT Name FROM Group WHERE Id IN :userGroupsIds];
for (Group queue : queues) {
return queue.Name == Constants.APPROVERS_QUEUE;
}
do this:
for (Group queue : [SELECT Name FROM Group WHERE Id IN: userGroupsIds]) {
return queue.Name == Constants.APPROVERS_QUEUE;
}
- Use equals (or equalsIgnoreCase) method (String class) instead of == to compare string values as it is more efficient.
e.g. instead of this:
if (book.MBMS_Status__c == book.MBMS_Previous_Status__c) {
continue;
}
do this:
if (book.MBMS_Status__c.equals(book.MBMS_Previous_Status__c)) {
continue;
}