Salesforce Admin Prep Notes - Salesforce Custom and Standard Functionality
Object: Fundamental building block that represents a table in the database where data is stored. Objects define the structure of the data and contain various components, features, and configurations. Here's what you get with an object in Salesforce:
- Fields: Objects consist of fields that represent the individual pieces of data stored in records. Fields can be of various types, such as text, date, number, picklist, formula, etc.
- Records: Records are instances of an object, representing a set of related data. For example, an "Account" object might have records for different companies.
- Page Layouts: Page layouts determine the arrangement and organization of fields on a record's detail and edit pages. You can customize page layouts to control the user interface for each object.
- Related Lists: Related lists display records from related objects on the detail page of a record. For example, on an "Account" detail page, you might see related lists for "Contacts," "Opportunities," and "Cases."
- Buttons and Actions: You can define custom buttons, links, and actions that allow users to perform specific tasks related to the object. For example, a custom button to create a new task associated with an account.
- Validation Rules: Validation rules ensure that data entered into records meets specific criteria. These rules help maintain data accuracy and consistency.
- Triggers: Apex triggers are pieces of code that execute before or after specific events, such as record creation, update, or deletion. Triggers are associated with objects and allow you to perform custom logic.
- Workflows and Process Builder: Workflows and Process Builder enable you to automate business processes by defining rules that trigger automatic actions, updates, or emails based on certain conditions.
- Reports and Dashboards: Objects provide the foundation for creating reports and dashboards. You can analyze and visualize data stored in objects to gain insights into your business.
- Search Functionality: Objects support search functionality, allowing users to search for specific records and filter results based on criteria.
- Security and Permissions: Objects come with built-in security features, allowing administrators to control access to records and fields based on user profiles and roles.
- Customization Options: You can customize objects extensively by adding custom fields, creating relationships with other objects, and defining various settings to tailor them to your organization's needs.
Standard and Custom Fields
Standard Fields: Every object is equipped with default built-in fields designed to capture essential business information. While these fields cannot be deleted, you have the flexibility to employ field-level security to conceal them. Additionally, if certain fields are unnecessary, you can exclude them from page layouts.
Customizing Field Labels: Personalize Salesforce by modifying standard field labels to align with your organization's business needs or enhance clarity for users regarding the field's purpose. Go to Setup | User Interface | Rename Tabs and Labels to update field labels.
Help Text: Help your users understand fields better by adding help text. Access the field-level help by following the click path Setup | Object Manager | [Object Name] | Fields & Relationships | [Field Name] | Edit.
Modifying Picklist Values: Customize predefined values in standard picklist fields by going to Setup | Object Manager | [Object Name] | Fields & Relationships | Name of the field.
Managing Data Classification: Categorize data sensitivity and compliance at the field level to influence decisions on access, reporting, and data compliance.
Creating Custom Fields: Add new fields tailored to your business needs on any standard or custom object. Customize them later or delete them as required.
Field Type Changes and Data Considerations: When altering a field type, be mindful of potential data loss. Deleted fields and their data are stored temporarily, so proceed cautiously, especially with fields containing data. Keep in mind that modifying fields with existing data may impact list views, assignment rules, and escalation rules. If possible, consider using new fields for modifications.
Steps for creating a custom Field:
- Select Data Type: Currency, Date, Checkbox, Picklist, Text, etc.
- Enter details: Label, Length, Picklist values, Description, Help Text
- Set Field-Level Security: Visibility and editability by profile.
- Add to Page Layouts: Define the page layouts that the field will appear on.
Picklists: Are a type of field that allows users to choose a value from a predefined list of options. They are commonly used to ensure data consistency and accuracy by limiting the available choices to a set list. Picklists can be used in various objects, both standard and custom, and they come in two main types:
- Standard Picklists: These are predefined lists of values provided by Salesforce. Users can select one value from the list.
- Custom Picklists: These are user-defined lists of values tailored to specific business needs. Admins can create and manage custom picklists for standard or custom objects.
Global Picklist Value Sets: In Salesforce are sets of values that can be defined once and then reused across multiple objects and fields. Instead of creating the same set of picklist values separately for different fields or objects, you can create a global picklist value set and associate it with multiple fields, making it easier to maintain consistency in your data.
Here are some key points about Global Picklist Value Sets:
- Consistency Across Objects: Global picklist value sets allow you to maintain a consistent set of values across multiple objects and fields. This ensures uniformity in data entry and reporting.
- Centralized Management: You define and manage the values in a global picklist value set in a centralized location. Any updates or additions to the values reflect automatically across all associated fields and objects.
- Reuse of Picklist Values: Once you create a global picklist value set, you can reuse it on various standard or custom objects, reducing the need to recreate the same set of values for each individual field.
- Efficient Updates: If you need to add, remove, or modify values in the picklist, you can do it in one central location. The changes will be applied globally to all fields using that picklist.
- Global Picklist Dependencies: You can set up dependencies between global picklists, allowing you to control the available values in a dependent picklist based on the selection in another picklist.
Dependent picklists: In Salesforce dependent picklists are a way to create a hierarchy or relationship between two picklist fields, where the values available in the dependent picklist are determined by the selection made in the controlling picklist. This functionality helps ensure that users select relevant and appropriate values based on the context of their selection.
Here's how dependent picklists work:
- Controlling Picklist: The controlling picklist is the first picklist that a user interacts with. The values chosen in this picklist determine the available options in the dependent picklist. The following can serve as a controlling picklist - Standard Picklist, Custom Picklist, Standard Checkbox, Custom Checkbox.
- Dependent Picklist: The dependent picklist is the second picklist that dynamically adjusts its available values based on the selection made in the controlling picklist. The fallowing can serve as dependent picklists - Custom Picklist, Custom Multi-Select Picklist.
- Dependencies: Dependencies are set up between the controlling and dependent picklists, specifying which values in the controlling picklist correspond to which set of values in the dependent picklist.
- Filtering Options: When a user selects a value in the controlling picklist, the dependent picklist is automatically filtered to display only the relevant options associated with the selected controlling picklist value.
- Enhancing Data Accuracy: Dependent picklists help ensure data accuracy by restricting users from selecting incompatible combinations of values. This is particularly useful when dealing with fields that have a hierarchical relationship, such as Country and State.
- Customization: Administrators can set up and customize dependent picklists for both standard and custom objects in Salesforce through the object's field settings.
Object Relationship Fields: Object Relationship Fields in Salesforce represent the connections or relationships between different objects. These fields are used to establish links between records of different object types, creating a relational structure within the Salesforce platform. There are two main types of Object Relationship Fields:
- Lookup Relationship: A Lookup Relationship creates a link between two objects, typically a parent-child relationship. It is a way to associate a record from one object with another without affecting the deletion or security of the associated records. When you create a lookup relationship, a foreign key is created on the child object, referencing the parent object's record.
- Master-Detail Relationship: A Master-Detail Relationship is a more tightly coupled relationship between two objects, where one object is the master (parent) and the other is the detail (child). The relationship is similar to a parent-child relationship, but it has additional characteristics such as roll-up summary fields and cascading deletion. Changes to the master record can affect the detail records, and deletion of the master record can result in the deletion of related detail records (cascading delete).
Relationship Field Filters: Are criteria applied to lookup relationships to filter the available records that users can associate with a particular record. These filters help control and restrict the options presented in the lookup field, ensuring that users can only link records that meet specific criteria.
Key points about Relationship Field Filters:
- Filtering Options: Relationship Field Filters allow administrators to define filter criteria based on fields in the related object. The criteria specify which records from the related object should be available for selection in the lookup relationship.
- Criteria Definition: Filters can be based on one or more fields in the related object, and the criteria can include conditions such as equals, not equals, contains, does not contain, etc.
- Data Relevance: These filters help ensure that users link records that are relevant to the context of the current record, promoting data accuracy.
- Dynamic Filtering: Relationship Field Filters can be dynamic, adjusting the available options in real-time based on changes to the record or changes in related data.
- Example Use Case: Suppose you have a custom object for "Accounts" and another for "Contacts." You can create a lookup relationship from "Contacts" to "Accounts" with a filter that only allows users to associate contacts with accounts located in a specific region or with a certain account type.
- Enhancing User Experience: By applying filters, administrators can enhance the user experience by presenting a more manageable and contextually relevant list of options when users are linking records.
Master-Detail Relationship Fields: Establish a strong, hierarchical connection between two objects: a master (parent) and a detail (child). Unlike lookup relationships, master-detail relationships are more tightly integrated, with significant implications for data structure and behavior.
Here are key points about Master-Detail Relationship Fields:
- Parent-Child Relationship: In a Master-Detail Relationship, one object is designated as the master, and the other as the detail. The master object controls certain behaviors of the detail object.
- Data Integrity: Master-Detail Relationships contribute to data integrity by enforcing referential integrity rules. Detail records are considered children of the master record, and changes to the master can affect the detail records.
- Cascade Deletion: If the master record is deleted, all related detail records are automatically deleted as well. This is known as cascading deletion and ensures that there are no orphaned records.
- Roll-Up Summary Fields: Master-Detail Relationships enable the creation of roll-up summary fields on the master object. These fields aggregate values from related detail records, such as sum, count, min, max, etc.
- Security and Access Control: Security settings, such as sharing rules and record-level security, are inherited from the master record to its detail records. This helps maintain consistent access controls.
- Creation of Master Record: When a new detail record is created, it must be associated with an existing master record. This ensures that every detail record is linked to a parent.
- Limitations: Master-Detail Relationships come with certain limitations, such as the inability to create cross-object formula fields, and the master object owning the relationship cannot be a part of a managed package.
- Example Use Case: If you have a custom object for "Orders" (master) and another for "Order Items" (detail), a Master-Detail Relationship between them means that each order has a set of related order items. Deleting an order would automatically delete its associated order items.
Junction Object: A custom object with two master-detail relationships, typically acting as an intermediary to connect two objects in a many-to-many relationship. It allows you to model complex relationships between records in a way that a direct master-detail relationship cannot achieve.
Here are key points about Junction Objects:
- Many-to-Many Relationship: Junction Objects are used to represent and manage many-to-many relationships between two objects. This means that records of one object can be related to multiple records of another object, and vice versa.
- Two Master-Detail Relationships: A Junction Object contains two master-detail relationships, each linking to one of the objects involved in the many-to-many relationship. These relationships create a hierarchical structure where the Junction Object sits in the middle, connecting the two related objects.
- Example Use Case: Consider objects for "Students" and "Courses." A many-to-many relationship exists because each student can enroll in multiple courses, and each course can have multiple students. A Junction Object named "Enrollment" could be created to manage this relationship. It would have master-detail relationships with both the "Students" and "Courses" objects.
- Data Modeling: Junction Objects are commonly used for data modeling in scenarios where a direct relationship between two objects is not sufficient to capture the complexity of the relationship.
- Ownership and Cascade Deletion: Junction Objects inherit cascade deletion behavior from the master-detail relationships. If either of the master records is deleted, the related junction object records are also deleted.
- Custom Fields and Logic: Additional custom fields and business logic can be added to the Junction Object to capture specific information about the relationship between the two master objects.
- Reports and Dashboards: Reports and dashboards can be created to analyze data across the related objects through the Junction Object, providing insights into the many-to-many relationship.
Custom Formula Fields
Custom Formula Fields: Allow you to create calculated fields that derive their values based on formula expressions you define. These fields can be used to perform calculations, manipulate text, and create dynamic content without the need for additional coding. Here are key points about Custom Formula Fields:
- Calculation Types: Custom Formula Fields support various calculation types, including mathematical operations, text manipulation, date functions, logical conditions, and more.
- Dynamic Content: Formulas can dynamically generate content based on the values of other fields or constants. This allows for the creation of dynamic and responsive data within Salesforce records.
- Field Types: The result of a formula field can be of different types, such as text, number, currency, date, percent, checkbox, etc., depending on the formula expression.
- Cross-Object Formulas: Formulas can reference fields from the same object or related objects, allowing for cross-object calculations. This is particularly useful in scenarios involving master-detail or lookup relationships.
- Formula Functions: Salesforce provides a wide range of built-in functions that can be used in formulas, such as mathematical functions (SUM, ROUND), text functions (CONCATENATE, LEFT), date functions (TODAY, MONTH), and logical functions (IF, AND, OR).
- Mathematical Calculation: A formula field can calculate the total price by multiplying the quantity and unit price fields.
- Text Manipulation: Concatenate two text fields to create a full name field.
- Date Calculations: Calculate the number of days between two date fields.
- Formula fields automatically update when dependent fields are modified, ensuring real-time calculation and accuracy.
- While formula fields are powerful, they have some limitations, such as not supporting complex business logic or database queries. In such cases, Apex code may be required.
Cross-object formulas: Allow you to create formulas that reference fields from related objects. This capability enables you to perform calculations or concatenate values across different objects in a relationship. Here are key points about cross-object formulas:
- Relationship Types: Cross-object formulas work with both lookup relationships and master-detail relationships.In a lookup relationship, you can reference fields from the related object using a cross-object formula.
- In a master-detail relationship, you can reference fields from the master object in the detail object's formula.
- Accessing Related Fields: Cross-object formulas use a syntax that allows you to reference fields on the related object. For example, if you have a custom object "Invoice" related to the standard "Account" object, you could create a formula on "Invoice" that references fields from "Account."
- Formula Syntax: The syntax for cross-object formulas involves using the related object's API name followed by a double underscore and the field name. For example, if you have a custom object "Order" related to "Account," you can reference the "Account" name field in a formula as follows: Order__r.AccountName__c.
- Roll-Up Summaries: Calculate the sum or average of related records' values using a cross-object formula.
- Dynamic Text: Create dynamic text fields that include information from related records.
- Conditional Logic: Use fields from related objects in conditional expressions.
Cross-Object Formula Limitations: While cross-object formulas are powerful, there are some limitations. For example, you can't use cross-object formulas in certain contexts like validation rules or workflow rules. Additionally, some functions are not supported in cross-object formulas.
- Example: If you have a custom object "Opportunity" related to the standard "Account" object, you could create a cross-object formula on "Opportunity" to concatenate the "Account" name with the opportunity name: Account.Name & "-" & Name.