Category: Trigger

Restrict Uploading Files In Salesforce

While working in Salesforce, we sometimes come up with the requirements where we need to build some sort of validation to restrict uploading files with specific extensions or in other words, allow only approved file types/extensions. This is very important because uploading executing or javascript code can bring potention security concerns by exposing internal data to outside world.

So allowing only certain type of files for upload is a very common requirement. In this blog post, I am sharing couple of solutions with pros and cons to implement this requirement.

Read More

Kitchener Developer Group brings Virtual Learning in March 2021

 “Live as if you were to die tomorrow. Learn as if you were to live forever” by Mahatma Gandhi.Why not develop a passion for learning in March? Kitchener, CA Developer group is happy to bring three virtual sessions in March 2021. Below you will find all the details of the sessions. Please RSVP.Session 1Title:  Using Styling Hooks to Customize Your LWCDate & Time: Thursday, March 11, 2021, 2:00 PM ESTSpeaker: Kirupa Chinnathambi, Senior Director of Product/UX at SalesforceRSVP: HereSession 2Title:  Let’s Learn About Heroku and How to Integrate with SalesforceDate & Time: Thursday, March 18, 2021, 2:00 PM ESTSpeaker: Julian Duque, Lead Developer Advocate at SalesforceRSVP: HereSession 3Title:  Orchestrate ALL of your Salesforce Automation with the Trigger Action FrameworkDate & Time: Thursday March 25, 2021, 2:00 PM ESTSpeaker: Mitchell Spano, Application Engineer at GoogleRSVP: HereLooking forward to seeing you all at these awesome events.Note – Please check out this page to access the presentation and recording from all the previous events from Kitchener, CA Developer...

Read More

Using Apex with Knowledge

 In continuation of my effort to make Lightning Knowledge easily understandable for all, today I am going to show how Salesforce Knowledge can be accessed using Apex. Salesforce Knowledge can have Apex Triggers and be accessible through Apex code. Actually, Salesforce provides some standard apex classes related to Knowledge Management that can be called for actions like publishing, editing as draft, archiving, and more.Before I start, I would recommend you going through my earlier posts -Understanding Salesforce Lightning Knowledge Data ModelHandy SOQL/SOSL Queries for KnowledgeWe can use the methods in KbManagement.PublishingService class to manage the lifecycle of an article. I am going to explain some of the few classes which developer needs mostly, but to know about all the methods, I highly recommend you going through the documentation here.Editing an Article as DraftWe can use the below method to edit an article as draft – String newId = KbManagement.PublishingService.editOnlineArticle(                    knowledgeArticleId,                     false               );Where the 1st input parameter is the KnowledgeArticleId (Note – This is not the Knowledge Record Id).2nd parameter is a Boolean value where false will not unpublish the already published articles and true will unpublish the already published article.This method will return the new draft master version ID of the article.Note – We need to keep this in mind that this method is not bulkified. So if...

Read More

How to choose between Trigger and Lightning Process Builder

With the introduction of Lightning Process Builder, we can do many things which were kind of limitations of Workflows. Salesforce introduces Lightning Process Builder as successor of Workflow rules, thus allowing more config options through click and reducing amount of apex customization required. Process Builder supports all the features from Workflows with the exception of sending outbound message without apex code. I will not be surprised if Salesforce decides to decommission Workflow in near future.Previously there were few scenarios (listed below) which were not possible through workflow and we need to write Apex trigger to achieve those. Here are few of them -If we need to perform complex validationBefore/After logic for record insert/update/delete/undelete operation.Update/insert any objects or related records.Problem with workflow is we can’t update child records with workflow. Workflow supports only updation of parent record. So earlier we need to go for Trigger. But with the introduction of Process Builder, now we can update child records as well. Below is one case study -Case Study:It’s a library management system – Universal Library. Library is having many books. If the book is not available, user will send the request for the book. The moment book is available, all the request status will change from ‘Hold’ to ‘Ready to Pickup’. To achieve this below is the object model -Here Book and Book Request are connected through Master-Detail relationship. Previously to...

Read More
Loading

Earlier Posts

  • 2024 (18)
  • 2023 (47)
  • 2022 (25)
  • 2021 (35)
  • 2020 (41)
  • 2019 (13)
  • 2018 (16)
  • 2017 (14)
  • 2016 (18)
  • 2015 (74)
  • 2014 (20)