Posts

Showing posts from April, 2021

How to debug record triggered flows?

Image
 After Summer 21 release we will be able to debug record triggered flows using the built in 'Debug Flow'.  Click the 'Debug' button on the flow canvas

How to Mass Transfer Opportunities using Salesforce Flows

Image
 Problem:  As an Sales Support Analyst, I would like to mass transfer opportunities between users. Salesforce 'Mass Transfer Records' ( Setup | Mass Transfer Records) does not provide opportunity mass transfer and usage of Dataloader is not an option. Solution:  A simple flow can do the trick. The flow can be added to the Home Page (conditionally rendered for certain Admin profiles) or a custom lightning App. Step 1: Navigate to Setup | Flow | New Flow | Screen Flow | Auto-Layout .  Step 2: Click the 'New Resource' button on the Toolbox Step 3: Click 'Add Element' and select 'Screen'. Drag 2 Picklist components into the canvas Step 4: Add 'Update Records' to the flow Step 6: Add the flow to Home page for testing Final flow:

Connecting to Anypoint platform from Anypoint Studio

Image
Anypoint Studio must be connected to Anypoint platform to perform following activities: Deploy an API to Cloudhub environment Publish/consume assets from Exchange Download RAML from Design Center The steps to connect to Anypoint platform through the studio are outlined below:  Traverse through Window>Preferences>Authentication Click on Add button in Authentication settings Click on Configure button in the User login page, which will open up Authentication method window. Choose Anypoint Platform unless authentication is performed through external identity provider like Okta, Ping Identity etc... If an external identity provider is used as an authentication mechanism, then select External identity option and enter the organization domain id Provide anypoint user credentials in Anypoint sigin page to get the user account added to the Authentication settings Organization domain id can be obtained from the user profile by logging in to Anypoint platform through browser. Note: If

How to mass update records in list view using quick actions?

Image
 Updating multiple records on list view can be done using a quick action. In this example lets add a 'Mass Update Leads' quick action to the Leads list view. Navigate to: Setup | Object Manager | Lead | Buttons, Links, and Actions | New Action Action Type: Update a Record Navigate to the action and click 'Edit Layout'. Drag and drop the fields that needs to be included in the mass update. If a field is a required field in the object then it has to be in the Layout or it has to added as a Predefined Field Value. Edit Layout:  Predefined Field Value:  Add the quick action to search layout by navigating to  Setup | Object Manager | Lead | Search Layout for Salesforce Classic | List View | Edit Lets test this 

How to get collection size in Lightning flow without iterating the collection?

Image
 Getting the number of records in a collection is often needed when developing an automation. Using the 'Loop' element to iterate the collection and increasing the count will be inefficient. A better way to do is to use the 'Assignment' element's 'equals count'. 

How to subscribe to BatchApexErrorEvent and send notifications in a flow?

Image
BatchApexErrorEvent notifies subscribers (Apex Triggers, Flows, Processes & Streaming API) of errors and exceptions that occur during the execution of a batch Apex class. This blog focusses on subscribing to the error event using no code flow approach. Prerequisite : The batch Apex class needs to implement Database.RaisesPlatformEvents Flow :  Create a new Flow and select 'Platform Event-Triggered' flow  Choose 'Batch Apex Error Platform Event' platform event  {!$Record} variable provides all the relevant information related to the Batch Apex Error which can be used in sending notification. Start:  Get Custom Notification Type:  Assign Notification Recipients (add to a collection): Send Notification: 

How to get CustomNotificationTypeId in flows without hardcoding?

Image
 Custom notifications are sent to desktop or mobile for anything that needs an user's attention. To get started we need to create a Custom Notification Type by navigating to Setup | Notification Builder | Custom Notifications | New . Creating a custom notification type lets us pick the channels for the notifications (Desktop or Mobile or Both). Problem:   Once we have the custom notification created, we need the CustomNotificationTypeId for using it with "Send Custom Notification" action  in the flow . We can use Developer Console or Workbench to fetch the Id. Problem with fetching the Id and using it hardcoded or storing it in a metadata and using it on a flow are as follows The Id will change when the flow is moved from a sandbox to production environment causing the flow to fail. Refreshing a sandbox will carry the production Id to sandbox and the flow will fail in sandbox. Solution:  Using "Get Record" flow component to get the custom notification record. Ge

Understanding vCore CPU utilization in MuleSoft CloudHub

Image
MuleSoft CloudHub platform offers multiple worker sizes to deploy APIs. The worker sizes range from slice of a vCore to full sized vCores. It is often sufficient to deploy APIs to slice of a vCore like 0.1 or 0.2 rather than to a one full vCore, unless the API is CPU intensive or the deployed application consists of many complex APIs packaged as a bundle. Most of us know that MuleSoft workers are AWS EC2 instances behind the scenes, but what we may not know is how CPU is utilized in a slice of vCore and what could be the possible implications of using a slice of vCore. The below table shows the various worker sizes and their corresponding EC2 instance types. Burstable Performance Instances: Instances providing slicing of vCores are called burstable performance instances. In these instances, full CPU utilization is achieved when an instance reaches baseline utilization percentage defined for the instance type. What happens when an instance hits baseline utilization percentage? Burstable

How to update related contacts when shared activities are logged using flow?

Image
What are Shared Activities? Shared activities is a feature that allows association of multiple contacts to a single task. This feature can be turned on by navigating to Setup | Feature Settings | Sales | Activity Settings. Turning on this feature may take up to 48 hours depending on the number of tasks that already exist in the Org. Problem: Standard LastActivityDate field in contact object does not get updated on all contacts when a task is associated to multiple contacts. Only the primary contact's LastActivityDate is updated by default. Reports using LastActivityDate will have wrong Activity Date. Solution: Create a custom datetime field and update the field using the flow to track contact activities. LastActivityDate is a read only field and cannot be updated.  Expanded view of flow components for reference: Record-Triggered Flow  Get Related Task Who Records  Iterate Task Who Collection Check if the Who type is 'Contact' Bulkify the Contact Update Collection by creat