Trigger on Salesforce File Upload
When the users upload files, it will be stored in ContentDocument Entity. So, develop a trigger on ContentDocument entity to fire when the users upload files in Salesforce. Sample Trigger: ....
When the users upload files, it will be stored in ContentDocument Entity. So, develop a trigger on ContentDocument entity to fire when the users upload files in Salesforce. Sample Trigger: ....
1. Setup/Enable Change Data Capture. https://www.infallibletechie.com/2019/05/change-data-capture-in-salesforce.html In this example, I have enabled Case object. 2. Create a Trigger. Sample Trigger: trigger CaseChangeEventTrigger on CaseChangeEvent ( after insert ) { ....
We can use a trigger on the AgentWork entity to update the Case Owner to Chat agent when the Chat is accepted in Salesforce. Sample Trigger: trigger AgentWork on AgentWork ....
For Common scenarios for Apex Trigger in Salesforce, check the following1. How to avoid closing Parent Case when child(related) cases are still open in Salesforce?https://www.infallibletechie.com/2022/02/how-to-avoid-closing-parent-case-when.html 2. How to update parent records ....
KnowledgeArticle is parent entity. KnowledgeArticleVersion is child entity. When a new Knowledge Article is created, it creates an entry in KnowledgeArticle and also in KnowledgeArticleVersion. When a new Knowledge Article ....
To prevent users from updating Notes in Salesforce, develop a trigger on Note object and throw an error when someone tries to update the notes. Sample Trigger:trigger NoteTrigger on Note ( ....
Sample Trigger:trigger CaseTrigger on Case ( before update ) { Set < Id > setCaseIds = new Set < Id >(); Map < Id, Integer > mapOpenCaseCount = new ....
To disable "Price Book" book selection while creating an Opportunity, the Pricebook2Id field should be populated. If the Pricebook2Id field is blank, it will prompt to select the Price Book. ....
Custom Field in Account to update when Contact is created: Sample Trigger: trigger ContactTrigger on Contact ( after insert ) { Set < Id > setAccountIds = new Set < ....
Requirement: Mark First Response Milestone as completed when the agent changes the status of the Case from New to Working. Note: IsCompleted field in CaseMilestone is not Writeable/Editable. So, this ....