msenyk / nodejs-tech-task2024

Тестове завдання для зимової практики Salesforce 2024
GNU General Public License v3.0
0 stars 1 forks source link

Show average weight of the pizza in recipe #18

Closed msenyk closed 10 months ago

msenyk commented 10 months ago

Pizza could have lots of ingredients. We might want to know approximate weight of cooked pizza. For example, 200 grams of dough is 180 grams in a final product. We should exclude weights of the package e.g. box, baking paper etc. Before implementing the solution, please, explain it.

katushhiaa commented 10 months ago

On the Recipe Item, I created the Quantity_coef field, which contains the coefficients for each Unit (Kilogram, Gram, Liter, Milliliter). Then in the field, New_Quantity calculated the new quantity using the formula: Quantity__c * Quantity_coef__c. On Recipe, I created a Weight field in which, using the Roll-Up Summary (SUM Recipe Item), using the New_Quantity field, I calculated the approximate weight of cooked pizza. Also applied Filter Criteria: Unit EQUALS Kilogram, Gram, Liter, Milliliter, in order to count only what is needed

RudInc commented 10 months ago

Ok, your approach is fine. Works as expected. It is smart move to use Roll-Up Summary and Filter Criteria