https://github.com/iam-royanirban/salesforce-files-system
Master the Salesforce File System ๐ | Learn, automate, and enhance your Salesforce file management with practical examples and tools. Access triggers, flows, and real-world use cases for managing files, sharing links, and more.
https://github.com/iam-royanirban/salesforce-files-system
file-search file-share file-sharing file-system salesforce salesforce-apex salesforce-files salesforce-lightning salesforce-metadata soql-query
Last synced: 3 months ago
JSON representation
Master the Salesforce File System ๐ | Learn, automate, and enhance your Salesforce file management with practical examples and tools. Access triggers, flows, and real-world use cases for managing files, sharing links, and more.
- Host: GitHub
- URL: https://github.com/iam-royanirban/salesforce-files-system
- Owner: IAm-RoyAnirban
- License: mit
- Created: 2025-01-11T07:11:33.000Z (5 months ago)
- Default Branch: main_branch
- Last Pushed: 2025-03-02T08:39:34.000Z (3 months ago)
- Last Synced: 2025-03-02T09:28:55.984Z (3 months ago)
- Topics: file-search, file-share, file-sharing, file-system, salesforce, salesforce-apex, salesforce-files, salesforce-lightning, salesforce-metadata, soql-query
- Language: Apex
- Homepage:
- Size: 1.85 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Understanding the Salesforce File System ๐
---
Explore how Salesforce manages files using the **ContentDocument**, **ContentVersion**, and **ContentDocumentLink** objects. This repository includes detailed resources and examples from my YouTube demonstration.
### ๐ฅ Watch the Video Tutorial to learn more:
YouTube: [Master Salesforce File Management System with Apex Triggers, SOQL & Flows (With Practical Use Cases & Examples)]([https:www.google.com](https://youtu.be/qIR5XIAvJvc))---
## Overview
This repository is designed for developers and Salesforce admins who want to:
- **Understand relationships** between the `ContentDocument`, `ContentVersion`, and `ContentDocumentLink` objects: their fields, usage, and purpose.
- Learn **Apex trigger-based scenarios** for handling file uploads, updates, deletions, and record associations.
- Explore **real-world use cases**, including:
- SOQL queries for retrieving records across various scenarios.
- Querying all related files and their versions for any record using Flows.
- Previewing files and their versions in a data table.
- Generating **secure, shareable links** with optional expiration dates and passwords for external access.---
## Key Points to Note โ ๏ธ
1. **On File Upload/Insert**:
- All three objectsโ`ContentDocument`, `ContentVersion`, and `ContentDocumentLink`โtriggers are fired.2. **On Uploading a New Version of a File**:
- Only the `ContentVersion` trigger is fired.3. **On Removing a File from a Record**:
- The `ContentDocumentLink` trigger is fired on deletion, identifying the related record using the `LinkedEntityId`.4. **On Deleting a File from Salesforce**:
- Only the `ContentDocument` trigger is fired.---
## Salesforce Documentation References
- [ContentDocument, ContentVersion, and ContentDocumentLink Terminologies](https://help.salesforce.com/s/articleView?id=000393095&type=1)
- [Trigger Behavior in Classic and Lightning Experience](https://help.salesforce.com/s/articleView?id=000381623&type=1)---
## ๐ Installation & Setup
1. Clone the repository:
```bash
git clone https://github.com/IAm-RoyAnirban/Salesforce-Files-System.git---
### Contributions
Feel free to fork this repository and contribute by submitting issues or pull requests. If you encounter any issues or need additional features, please raise a GitHub issue.---
### License
This project is licensed under the MIT License - see the [LICENSE file](https://github.com/IAm-RoyAnirban/Salesforce-Files-System/blob/main_branch/LICENSE) for more details.