I am trying to give only the important questions that are required during the interview process. It is always good to read some extra questions as well but you can always keep revising these questions.
1. What is a Master-Detail Relationship?
Answer:A Master-Detail relationship in Salesforce establishes a parent-child relationship between two objects. The parent object (master) controls the behavior of the child object (detail). Child records inherit security settings, sharing rules, and deletion behavior from the parent.
2. What is a Junction Object?
Answer:A Junction Object is a custom object used to create a many-to-many relationship between two objects that wouldn’t naturally have a direct relationship. It contains two Master-Detail relationships—one to each of the objects you want to relate.
3.What will happen if you delete one of the master objects in a Master-Detail relationship?
Answer:Deleting a master object in a Master-Detail relationship will result in the deletion of all associated child (detail) records as well. This behavior ensures data integrity.
4.What will happen if you undelete one of the master objects in a Master-Detail relationship?
Answer: Undeleting a master object will also restore all the related child (detail) records that were deleted when the master was initially deleted.
5.Suppose we have read access on one of the parent objects and no access on the second object. Will the person be able to access the junction object record?
Answer:Yes, the person will be able to access the junction object record even if they don’t have access to one of the parent objects. Junction object records can be accessed as long as there’s at least read access on one parent object.
6.What is Explicit and Implicit Sharing?
Answer:Explicit Sharing involves manually sharing individual records with other users, while Implicit Sharing automatically grants access to related records based on parent-child relationships, such as in Master-Detail or Lookup relationships.
7.Difference Between Custom Metadata and Custom Setting.
Answer:Custom Metadata provides the ability to create metadata records that can be treated as customisable data, while Custom Settings store customisable settings that can be accessed in Apex code. Custom Metadata is deployable, and changes to Custom Settings require migration.
8.What is the difference between Profiles and Roles?
Answer:Profiles control what a user can do in Salesforce, including object permissions, field permissions, and more. Roles, on the other hand, define a hierarchy that impacts record visibility and access.
9.What is an External ID?
Answer:An External ID is a custom field that contains unique record identifiers from an external system. It can be used to relate records between Salesforce and external systems for data integration purposes.
10. Explain the order of execution in Salesforce.
Answer: On the server, Salesforce follows a specific sequence of events when processing a record. This sequence ensures that data integrity, validation, and automation are properly executed. Let’s break down the order of execution:
1. Load Original Record:The process begins by loading the original record from the database or initialising a new record for an upsert operation.
2. Load New Record Values:Salesforce loads the new field values from the request and replaces the old values with the new ones.
3. System Validation Checks:Various system validation checks are performed based on the type of request:
– Compliance with layout-specific rules
– Presence of required values at layout and field-definition levels
– Valid field formats
– Maximum field length
– For User object requests, custom validation rules are also executed.
4. Record-Triggered Flows (Before Save): If configured, record-triggered flows that are set to run before the record is saved are executed.
5. Before Triggers: All before triggers are executed. These triggers allow you to perform custom logic, calculations, and data transformations before saving the record.
6.System Validation (Again): Certain system validation steps are repeated, including ensuring required fields have values. Layout-specific rules enforcement is skipped.
7.Duplicate Rules: Duplicate rules are executed. If a duplicate rule identifies a record as a duplicate and uses the “block” action, the record isn’t saved, and no further steps are taken.
8.Save Record (Database Operation): The record is saved to the database, but the changes aren’t committed yet.
9. After Triggers: All after triggers are executed. After triggers enable additional actions and updates based on the record’s changes.
10. Assignment Rules: Assignment rules are executed, which may assign the record to specific users or queues based on criteria.
11. Auto-Response Rules: Auto-response rules are executed, triggering automated email responses for leads and cases.
12.Workflow Rules (First Execution): Workflow rules are executed, performing actions like sending email alerts, updating fields, or creating tasks. If workflow field updates are configured, the record is updated.
13. Before Update Triggers (Again): Before update triggers are executed one more time, regardless of whether the operation is an insert or an update.
14. After Update Triggers (Again): After update triggers are executed one more time.
15. Escalation Rules: If escalation criteria are met, escalation rules may be executed to escalate cases or records to higher-level support.
16. Salesforce Flow Automations: These include processes, flows launched by processes, and flows launched by workflow rules (flow trigger workflow actions pilot). When a process or flow executes a DML operation, the record goes through the save procedure.
17. Record-Triggered Flows (After Save): Record-triggered flows set to run after the record is saved are executed.
18. Entitlement Rules: If configured, entitlement rules are executed, ensuring that service level agreements (SLAs) are met.
19. Roll-Up Summary Fields: If present, roll-up summary fields are updated in parent records based on related child records.
20. Criteria-Based Sharing Evaluation: Evaluation of criteria-based sharing rules determines if additional sharing is required.
21. Commit DML Operations: All data manipulation language (DML) operations are committed to the database. Changes become permanent.
22. Post-Commit Logic: After changes are committed, post-commit logic is executed. This may include sending emails, enqueuing asynchronous Apex jobs, and executing asynchronous paths in record-triggered flows.
Understanding this detailed order of execution is essential for designing effective processes and automations in Salesforce. It ensures that actions, validations, and updates occur in a controlled and predictable manner, leading to accurate data management and a seamless user experience.