Standard and Custom Objects, 14%

Describe the standard object architecture and relationship model. Explain how to create, delete, and customize fields and page layouts on standard and custom objects, and understand the implications of deleting fields. Given a scenario, determine how to create and assign page layouts, record types, and business processes for custom and standard objects.

Course Introduction - Standard and Custom Objects Knowledge Area Overview

Standard Objects and Relationships

  • Object Manager in setup is the place to view and manage objects
  • Best place to visualize relationships between objects is the Schema Builder. Accessible at Settings > Objects and Fields > Schema Builder
    • Master-Detail relationships in Red
    • Lookup Relationships in Blue
  • “Self-Relationship” - relationship an object has with itself
  • Objects that will be important for this section:
    • Opportunity, Contact, Case, Campaign, Campaign Member, Products, Price Books, Opportunity Products
  • Per MW, three primary tenants of business (especially B2B). Note these are apps set up in Salesforce for each of these core functions.
    • Marketing: attract new customers
    • Sales: attain new customers
    • Service: retain new customers
  • Marketing: Leads qualified and converted to Contacts and then to Opportunities and then to Account. At that point the account is transitioned to Sales.
  • Hierarchical relationships are fairly rare in Salesforce.

Creating a Custom Object

  • Custom objects are generally any noun - a person, place, or thing
  • Record names can be Text or Auto-Numbers with a specified format
    • When creating new custom objects, enable all optional features: Allow Reports, Allow Activities, Track Field History, Allow in Chatter Groups
    • Can set up tab visibility defaults when creating a new custom object

Granting Access Using Hierarchies

  • Edit via Setup > Sharing Settings
  • Grant Access Using Hierarchies can be unchecked for custom objects only
    • If default internal access is Pricate and this checkbox is unchecked, then records they own will not be visible to people above them in the role hierarchy

Master-Detail Relationships

  • When creating a master-detail relationship, the currently selected object is the Child. The other object will be the Master.
    • A common object to be Master is the Account object.
  • Master-Detail relationships are the “closest” relationship you can have in Salesforce per MW.
  • When creating a new Master-Detail relationship, can “Allow Reparenting” so that detail records can have their parent changed.
  • Advantages of Master-Detail Relationships over lookups:
    1. You can only create rollup summary fields leveraging Master/Detail records.
    2. You can create Junction Objects (many-to-many relationships) via two master-detail relationships.
    3. See this Salesforce help article, linked by MW, for more detail.
  • Cannot create a master-detail relationship if records already exist on that object. Need to create Lookup first, then convert to Master-Detail.

Lookup Relationships

  • Can optionally make lookup relationships disallow deletion of a related record.

Standard Fields

  • On custom objects there are a handful of Standard Fields that cannot be deleted.
    • For example, Currency might be present if Advanced Currency management is turned on. This cannot be deleted but can be replaced.
    • Others: Created By, Last Modified By

Creating Custom Fields

  • Default Values for custom fields can be derived based on a formula.

Customizing Page Layouts

  • If “Track Field History” is turned on for an object, an “Object History” related list will be available in the Page Layout. This can be added as a “Related List” on the page layout.

Deleting Custom Fields

  • Deleting a custom field:
    • Deletes all dependent info for any dependent or controlling field
    • Changes the result of Assignment or Escalation Rules that rely on the custom field data
  • After delete, the field appears in the deleted components list for 15 days. During that time, the field can be undeleted and the data will be restored. After 15 days, it is permanently deleted.
    • At time of these notes, “Deleted Fields” are only available in Salesforce Classic
    • “_del_” is appended to the API Name, among other changes

Changing Data Types on Fields and Data Loss

  • If a field is changed from a Multi-Select Picklist to a Picklist, the data in the field is lost.
  • If a field is changed from a Picklist to a Multi-Select Picklist, only inactive picklist values are lost, but the data in the field is not lost.

Setting Field Dependencies

  • Field Dependencies are a means of making the values available in one picklist dependent upon the value selected in another picklist.
    • Includes Controlling and Dependent fields.
    • Pickilists can be either Controlling or Dependent
    • Multi-select picklists can be Dependent but not Controlling

Sample Exam Question #2

  • The certification test designates how many of the multiple choice options the test taker should choose from.

Enabling Field History Tracking

  • Field History Tracking must be enabled on per-object basis.
  • Once enabled, turn on on a per-field basis by clicking through the “Set History Tracking”
    • Can track up to 20 - should always track as many as possible
  • Ensure that the field history is available and visible by making sure the History related list is in the page layout

Customizing and Creating Page Layouts

  • Related lists can be edited via the Page Layout editor for an object.
  • Some related lists are customizable. These have the wrench icon.
  • Page Layouts can be used to show different information to different user profiles.
    • Reference Page Layout Assignments button

Setting and Assigning Field Level Security

  • To change field-level security, navigate to the field then select “Set Field-Level Security”
    • Fields can be hidden from System Administrators, too
  • Field Level Security overrides View All, Modify All permission at the Object level
  • Other possibility is to use the “View Field Accessibility” button, which lets admins set field-level security and the page layout

Page Layout Assignments

  • Common for admins to create a Page Layout specific to Admins with extra reference info
  • Can clone page layouts by doing a save-as from within the page layout editor
  • When creating a formula field, use the Advanced Formula field to easily create references to fields on related objects:
    • Ex admin ref field: Account__r.Name + ' ' + Text(Start_Date__c) + ' ' + CreatedBy.Username

Creating Record Types for Custom Objects

  • Record Types enable assignment of different page layouts depending on the record type
  • Per MW, best practice is to avoid introducing Record Types until absolutely necessary
    • Complicates development of the object
    • Not easy to go back to not having record type, once introduced
  • Record Types also control which picklist values are available

Page Layout Assignments by Record Type

  • A common scenario is to need to move from an object with a Type field to an object with Record Types
    • In that scenario, the best practice is to ensure that all the existing objects have an appropriate record type selected, and then to remove the Type field
  • Different Page Layouts can be assigned By Profile, By Record Type in a matrix on the Page Layout Assignment page

Business Processes for Standard Objects

  • Three key standard business processes built into Salesforce:
    • Lead Processes - ties into Lead object
      • Uses “Lead Status” field
    • Sales Processes - ties into Opportunity object
      • Uses “Stage” field
    • Support Processes - ties into Case object
      • Uses “Status” field
  • Navigate to these Processes via: Setup > Quick Find > “processes”
  • Must have a Sales Process set up before creating an Opportunity, Lead, or Case record type

Business Processes for Custom Objects

  • Custom objects with not have a process available in the Setup quick find menu
  • As with Leads (Lead Status), Opportunities (Stage), and Cases (Status), we can define a Phase for our custom object, “Project":
    • Phase could be implemented as a Picklist with possible values:
      • Requirements Gathering, Design, Development, Implementation, Installation, Site Inspection, Quality Assurance, User Acceptance Testing

Creating a Path to Support Business Processes

  • The Path chevron visual is common to Leads, Opportunities, and Support processes
  • Enable the Path visual for custom objects via: Settings > Quick Search > Path
    • Step through the wizard to setup a new Path
      • Each phase can have certain fields selected to be included.
        • Possible to make some of these fields required by using Validation Rules
      • Each phase can also have specific textual “Guidance for Success.”
  • Once the path is enabled, still need to add it on the Lightning Page
    • Access the record page for the object, then Gear Icon > Edit Page. This opens the Lightning App Builder.
    • Add a Path component where appropriate on the page, save, activate.
  • To reorder the phases in the path, reorder at the field level on the object.