Salesforce Application to track and rate craft beers.
My husband and I are big craft beer lovers. We live in Phoenix, Arizona and there are a ton of breweries in the Valley of the Sun. We drink many different beers that we started to lose track of our favorites. After seeing a LinkedIn post from Nick Bryner encouraging new Salesforce professionals to create a Movie Rating App, it clicked – I can create a Beer Review App on Salesforce to keep track of what we drink and enjoy.
The Account Object is the primary object for the Breweries and I renamed the tabs in the app to Breweries.
Then I created two custom objects:
Beer (beer__c)
Review (review__c)
Both are master-detail lookups, because if there was not a brewery, then there would not be a beer or a review. They are linked together arm-in-arm and if the Parent (Brewery or Beer) is deleted the children would be too (Beer and Review).
The tricky part was to connect the user to the review. The User Object needed to be the master in the master-detail relationship, but one cannot create a master-detail relationship in which the User
object is the master (Reference).
Instead, I created a lookup field to the User Object and made it required.
We are primarily going to be using this app on the go on our mobile devices so I didn’t want too many required fields. We might have had too many beers and forget to enter everything. The three fields we wanted to track
consistently were the name of the brewery, the city, and the state. Because the billing address on accounts can’t be marked as required on the page layout,
I created a validation rule to make sure that the city and state are entered.
Validation Formula:
AND(OR(ISBLANK(BillingCity), ISBLANK(BillingState)))
There is also a rollup summary field “Number of beers” that calculates how many beers we reviewed from that brewery.
All beers come with a name, ABV, and a style. I made these fields required because I thought it would be fun to see what the typical ABV and style we drink (right now it’s 6.3% ABV and Sours).
The Style field is a picklist and the values are from Wikipedia. I had no idea there were SO many beer styles. The other style field is where the user can input a style of beer that isn't in the picklist field. The description field is to put a small explanation of the beer. Some craft beers have very interesting flavors. The Thai Fighter has coconut, lactose, and Thai Tea leaves.
There are two rollup fields that calculate how many reviews there are and the average.
But wait! Rollup fields can’t do averages.
That is why I created a sum rollup field and a formula field (average rating) that took the sum of the reviews and divided it by the number of reviews
Validation Formula:
total_Reviews__c / Number_of_Reviews__c
The Rating Object has two primary fields - the rating from 1 - 5 (1 being awful and 5 being the best) and a text review of the beer.
I decided on a 1 to 5 rating scale because it's very typical for most products to be rated from 1 to 5. The field does allow for decimals. Sometimes a beer isn't a 3 or a 4, but maybe a 3.5. There is a validation rule that does not allow
a rating under 1 or over 5.
Validation Formula:
OR(Rating__c < 1, Rating__c > 5.00)
The "What did you think?" field is a place where users can put their thoughts on the beer for others to read and compare.
This app is always ongoing tweaks the more my husband and I use it. We find we need to add more validation rules (like City and State required) so we don't mess up the data when we had a few too many beers.
The next step is to create a screen flow that we can use on the go to add breweries, beers, and reviews. So stay tuned!