πŸ—οΈ

Object Architecture, Fields, and Lightning App Builder

Object relationships, custom fields, and UI design with Lightning App Builder.

⏱️ Estimated reading time: 30 minutes

Mastering Objects and Schema Builder

Objects are the backbone of Salesforce.

- Standard Objects: Cannot be deleted. Admins can change their labels (Rename Tabs and Labels), but the API name remains the same.
- Custom Objects: Have features you must opt-in to: 'Allow Reports', 'Allow Activities', 'Track Field History'.

Schema Builder: Not just for visualization; it's an admin tool that allows real-time creation of objects and fields. Exam Note: Fields created here are NOT automatically added to Page Layouts; you must do that manually afterward.

🎯 Key Points

  • βœ“ Difference between 15-character ID (case-sensitive, used in UI) and 18-character ID (case-insensitive, used in API)
  • βœ“ Undelete: Deleted objects stay in the recycle bin for 15 days
  • βœ“ External Objects: Access data outside Salesforce without using storage
  • βœ“ Custom objects always include the '__c' suffix

Relationships: Master-Detail, Junction, and Hierarchy

Relationships define data flow and security.

- Master-Detail: The parent controls visibility. If the parent is deleted, children are deleted (Cascade Delete). Reparenting: Not allowed by default unless you check 'Allow Reparenting' on the field.
- Junction Objects: Create M:M (Many-to-Many) relationships. An object with two Master-Detail relationships (e.g., Candidates and Jobs linked by 'Application').
- Hierarchical Relationship: Only exists on the User object to create manager hierarchies.

🎯 Key Points

  • βœ“ An object can have a maximum of 2 Master-Detail relationships
  • βœ“ You cannot create a Master-Detail relationship if the object already has records (hack: create Lookup, fill data, convert to M-D)
  • βœ“ Lookup: Field can be optional or required; does not affect record Owner
  • βœ“ Roll-up Summary: Only available on the Master object of an M-D relationship

Field Types and Data Conversion

Salesforce has specific field types with critical conversion rules.

- External ID: Unique field used to import data from external systems (max 25 per object).
- Formula Fields: Automatic calculations. Cannot be edited. Can use data from parent objects (Cross-object formulas).
- Conversion: Changing from 'Checkbox' to 'Text' is safe. Changing from 'Text' to 'Picklist' may cause data loss if values don't match.

🎯 Key Points

  • βœ“ Roll-up Summary: Supported types: COUNT, SUM, MIN, MAX
  • βœ“ Geolocation: Stores latitude and longitude as a single field
  • βœ“ Auto-number: Generates custom sequential IDs (e.g., INV-001)
  • βœ“ If you convert a Master-Detail field to Lookup, you lose the Roll-up Summary fields

Record Types, Path, and Layouts

Record Types are the primary tool for process segmentation.

Logical Exam Flow:
1. Create the Business Process (sales/support stages).
2. Create the Record Type and assign the process to it.
3. Assign the Page Layout to the Record Type and User Profile.

Path: Visual tool in Lightning to guide users through process stages. You can add 'Key Fields' and 'Guidance for Success' for each stage.

🎯 Key Points

  • βœ“ A Record Type controls: Picklist values, Page Layouts, and Business Processes
  • βœ“ For standard objects like Accounts or Contacts, you do NOT need to create a pre-process
  • βœ“ Admins can assign Record Types via Profiles or Permission Sets
  • βœ“ If a user only has access to one Record Type, Salesforce won't prompt them to choose one when creating a record

Lightning App Builder and FlexiPages

The Lightning App Builder creates 'FlexiPages'.

Assignment Levels (Hierarchy):
1. Org Default: What everyone sees if nothing more specific is set.
2. App Default: Overrides Org Default for a specific app (e.g., Sales App).
3. App, Record Type, and Profile: The most granular and powerful level.

Dynamic Forms: Allow field-level conditional visibility. This eliminates the need to create dozens of Page Layouts just to hide fields based on record status.

🎯 Key Points

  • βœ“ Dynamic Actions: Allow showing buttons (e.g., 'Close Case') based on logical criteria
  • βœ“ Analytics Components: You can embed reports directly onto a record page
  • βœ“ Mobile Compatibility: You can preview how the page looks on phones and tablets
  • βœ“ Rich Text Component: Used to display warnings or visual instructions on the page