Skip to main content

Posts

Showing posts with the label Sneak Peek

Sneak Peek: Handle Record Delete triggers using Flow Automations

Traditionally, within Salesforce platform, only Apex triggers were equipped to handle record delete events. For any custom handling of delete actions, one had to create and maintain Apex code. Not to mention, be mindful of the best practices of handling deletions in bulk and displaying error messages. Salesforce flows have been graduated to now handle on delete events for objects within Salesforce. So, now you can create a flow which gets triggered on record delete. Step by Step Guide Let's take a sample scenario (probably most used). Let's say you want to restrict any user to delete an Account of type Customer. Following are the steps to create flow Step 1 : Create a flow of type Record Triggered Flow Step 2 : Set Entry Criteria Set Trigger to A record is deleted Set Entry conditions to qualify only active customer accounts Step 3 : Add new Custom Error Add new element attached to Start element and select Custom Error element from the list Step 4 : Setup Error Message Add er...

Sneak Peek: Lightning Web Components

With latest announcement of Lightning Web Components, Salesforce development ecosystem (Lightning Platform) moves one step closer to using web standards of UI development. It is definitely quite welcome move, as it helps in learning and utilizing skills which are not confined to Salesforce ecosystem. You must read this official Salesforce blog post to get more background details on why and what of lightning web components. Background User interface development has evolved drastically in past decade. With introduction of AngujarJS (2010), javascript based front end development became more modularized and then with React (2015) it became much faster, lightweight and component driven. So, front end layer is no longer confined to lightweight ui and graphics. Instead, with Single Page Applications (SPA), you can have pretty much an entire application running on browser (serverless). Web Components " Web Components is a suite of different technologies allowing you ...

Sneak Peek: Visualforce with Javascript Promises

While working with Visualforce pages along with javascript remoting functionalities, we often create a lot of callback methods. On top of it, multiple invocations in a chained approach is more chaotic, often hardcoded and leaves code quite unreadable.   Following is an example code while using Javascript remoting within Visualforce page:-   function invoke_remoteService1 (){ console .log ( ' Invoking remote service 1' ); Visualforce.remoting.Manager.invokeAction( '{!$RemoteAction.testWebServiceController.remoteService1}' , remoteService1_ResponseHandler); } function remoteService1_ResponseHandler (response, event){ console .log ( ' Response from remote service 1 = ' + response); if (response ! = null ){ console .log ( ' Invoking remote service 2' ); Visualforce.remoting.Manager.invokeAction( '{!$RemoteAction.testWebServiceController.remoteService2}...

Sneak Peek: Encrypted Custom Fields

What? Alphanumeric fields which would contain data in encrypted form. Mostly to be used in case of government regulations, as they have processing overhead and certain limitations for e.g. these fields cannot be unique, indexed or have default values. Also, there is a limit of 175 characters. Where? Custom encrypted fields can be be used in various applications and can be displayed on page layouts and can be even included for validations via validation rules and apex code. Why? Certain business needs or government regulations require certain data to be stored in encrypted state and displayed in masked form. For e.g. Social security numbers or credit card numbers. Salesforce makes it easy to achieve it via Custom encrypted fields.  How? Custom encrypted fields can be created as just another custom field with type selected as " Text (Encrypted) ". Master Encryption key key to be used for data encryption can be managed via " Certificate and Key Management " und...

Sneak Peek: Checkpoints (a.k.a. Simulated Breakpoints)

What? Simulated breakpoints a.k.a. checkpoints enable developers to assign breakpoints to assess stack values at that point of execution. Where? Simulated breakpoints are available in new Developer console.  Why? At many occasions developers need to assess variable/ instance values during execution. This comes in very handy especially when debugging something in production wherein developers cannot add "system.debug" statements at their will. With breakpoints, developers can very well place breakpoints at desired code locations and execute the code to get breakpoint results How? To create checkpoints, open a class/ trigger in developer console and click on left hand side (just next to line no.). Once added, you can view your breakpoints in "Checkpoint Locations" sub tab within Checkpoints tab.  Each execution of class/ trigger generates Checkpoint data in "Checkpoints" sub tab. Double click on the individual checkpoint log, to view correspondin...

Sneak Peek: Publisher Actions

What? Extends chatter's capabilities to enable user to take custom actions for e.g. create a new related record or access a visualforce page. Where? It would be accessible via chatter section on Chatter tab, home page or chatter section in detail page of an object. Why? Publisher actions lets administrator/ developer expose additional functionalities to users via chatter feeds. So, now a user can create a new record from chatter feed as he/she used to create new post/ poll etc. For e.g. a user viewing account detail page can create a contact/ opportunity related to the Account, without navigating to any other page. How? Actions can be created from Object setup page or via "Buttons Links and Actions" link for each standard object in Setup and Administration section. There are two types of actions:- Create action :- allows user to create a new record. Administrator can define the fields to be displayed in the create page layout. Additionally, administrator c...

Sneak Peek: Salesforce Polymorphic keys

What? Polymorphic key is a relationship field which can relate to more than one type of object as parent. Unlike Lookup and Master-detail relationships which are related to a single object, Polymorphic keys can refer to multiple objects. Where? As of date, Polymorphic keys cannot be created by developers. They are available for specific objects out of the box for e.g. WHOID and WHATID in Task and Event objects. Why? As we know, Salesforce’s data model is strictly relationship based, and the type of objects at both the ends of the relationship is fixed. So, if an object is to be related with multiple objects, then a separate relationship field has to be created for each relationship. Polymorphic keys are required to maintain relationship with multiple types, for e.g. task/ event might be related with various type of records viz. Account, Contact etc. So, a polymorphic key helps in establishing unique access to such disparate relationships. How? Polymorphic keys ...

Sneak Peek: Salesforce Permission Sets

With permission sets available for some time now, there have been lot of discussions around what is real use of permission sets, what they are capable of, when to use them and when to stay away from them. I am hereby trying to put in some views What? A Permission set is a configuration based mechanism to provide additional capabilities to users, on a temporary basis. It can be viewed as a subset of Profile, wherein it has similar capabilities to define security permissions, but has few lesser options. Where? Permission sets should be used primarily for temporary basis, wherein the access is to be provided for shorter time duration and the access can be removed later.  It can however be used to provide additional access to certain users, as compared to other users using same profile. But, in this case, usage of permission sets is elongated, its suggested to rather create a new profile. Why? It provides a very flexible and easy approach to give additional permis...