PDI · Question #126
When a user edits the Postal Code on an Account, a custom Account text field named ''Timezone'' must be updated based on the values in a postalCodeToTimezone_c custom object. What should be built to…
The correct answer is A. Account custom trigger. To update a custom field on an Account based on changes to another field and data from a custom object, an Apex Account custom trigger is the appropriate solution.
Question
When a user edits the Postal Code on an Account, a custom Account text field named ''Timezone'' must be updated based on the values in a postalCodeToTimezone_c custom object. What should be built to implement this feature?
Options
- AAccount custom trigger
- BAccount approval process
- CAccount assignment rule
- DAccount workflow rule
How the community answered
(31 responses)- A71% (22)
- B16% (5)
- C10% (3)
- D3% (1)
Why each option
To update a custom field on an Account based on changes to another field and data from a custom object, an Apex Account custom trigger is the appropriate solution.
An Account custom trigger, specifically a `before update` or `after update` trigger, can capture changes to the Postal Code field. Within the trigger, Apex code can query the `postalCodeToTimezone_c` custom object and then update the 'Timezone' field on the Account record programmatically.
An Account approval process is used for managing records that require approval before they can be saved or moved to the next stage, not for dynamically updating field values based on complex lookups.
Account assignment rules are used to automatically assign records (like Leads or Cases) to users or queues based on specific criteria, not for updating fields on existing records.
Account workflow rules can update fields, but they are limited to simple field updates or formula-based calculations and cannot perform complex lookups to a related custom object to determine the value.
Concept tested: Apex triggers for complex data manipulation
Source: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_intro.htm
Topics
Community Discussion
No community discussion yet for this question.