PLAT-ADMN-202 practice question 14 of 35

Ann app builder has been to display an overdue date that is two months after a tasks due date. Which approach should the app builder take?

Full set: 311 questions

Domain Service and Support Applications

Answer options
A: Use process builder and set overdue date equal to Due Date + ((365/12)*2)
B: Create a formula field using Due Date + 60
C: Use process builder and set overdue Date equal to Due Date + 60
D: Create a formula field using the ADDMONTHS () function Correct answer
Correct Answer:
D. Create a formula field using the ADDMONTHS () function
Explanation

The most accurate and efficient method to calculate a date that is a specific number of months from another date is by using a formula field with the ADDMONTHS() function. This function is designed to correctly handle the varying lengths of months and leap years. For example, ADDMONTHS(DueDate, 2) will add exactly two calendar months to the DueDate field, ensuring precision regardless of whether the starting month has 28, 30, or 31 days. A formula field is appropriate as the value is always derived from another field on the same record.

Why Incorrect

A. Use process builder and set overdue date equal to Due Date + ((365/12)2): This calculation is an approximation and will not yield an accurate calendar date. Process Builder is also less efficient than a formula field for this requirement.
B. Create a formula field using Due Date + 60: Adding a fixed number of days (60) is not equivalent to adding two months, as months have different lengths. This will lead to incorrect dates.
C. Use process builder and set overdue Date equal to Due Date + 60: This shares the same logical flaw as option B; adding 60 days is an inaccurate way to calculate two months. Using Process Builder does not correct the faulty calculation.

References

1. Salesforce Help Documentation, "Formula Operators and Functions A–Z": The ADDMONTHS(date, num) function is explicitly defined for this purpose. The documentation states, "Adds num months to date... If the resulting month has fewer days than the starting month, the function returns the last day of the resulting month." This confirms it is the correct tool for adding calendar months.

Source: Salesforce Help, "Formula Operators and Functions A–Z", under the ADDMONTHS entry.

2. Salesforce Help Documentation, "Date and Date/Time Functions": This page details functions for handling date values. It lists ADDMONTHS as the standard function for adding or subtracting a specific number of months from a date, reinforcing its suitability over simple arithmetic addition of days.

Source: Salesforce Help, "Date and Date/Time Functions".

3. Salesforce Architects, "Record-Triggered Automation Decision Guide": This guide helps architects and builders choose the right tool. For a requirement to calculate and display a value on the same record based on one of its fields, a formula field is recommended for its simplicity and real-time execution before a record is saved, making it more efficient than a record-triggered flow (the successor to Process Builder).

Source: Salesforce Architects, "Record-Triggered Automation", section "Before-Save: Update fields on the record".

Scroll to Top