Skip to main content

Posts

Quick Tips: Revive an old machine with Lubuntu

What would you do if you have a 10+ year old laptop that is but too old to run any version of Windows. Unless you can actually donate it or make use of it, most likely, it'll be lying there for too long. I had a similar situation, so, I thought of utilizing it for my hobby activities. Hereby I'm sharing some quick steps that you can also use to renew your old computer/laptop. With these steps you can get a renewed laptop which feels snappier and powerful. As you may be familiar, with Linux, you get a much powerful operating system and access to mighty open source tools/applications. Why Lubuntu Lubuntu is arguably the most lightweight Linux for desktops and PCs. It uses as less as 500MB RAM and can work for a wide range of old processors. As its built on top of Ubuntu, the support for devices is extremely wide (probably widest) and is quite easy to install and use for beginners. Pre-Requisites Before getting started you would need: Laptop/Desktop with internet connection (in t...

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...

Quick Tips : Use SFDX Auth token within CURL requests (Mac/ Linux)

I came across a peculiar requirement recently, wherein we needed to download files in a scheduled job. As you all know downloading a file can be a tricky affair with Salesforce.  Fortunately, using REST API we can achieve it. So, the solution became somewhat easier, wherein we could make a CURL call and download the file.  However, all usual cases reference using login name/ password or some reference using the Connected app (OAuth) route. For my specific use case, I already have a machine setup with SFDX and with target orgs authenticated. This solution helps just in that case. With command line scripting it is quite easy (for folks who are experienced with the command line). It took some time for me to get it working. Note: This approach should be chosen after appropriate review/analysis of other approaches, namely, OAuth-based login flows for app authentication. Tools used SFDX - to retrieve auth tokens Curl - to make API calls via the command line  JQ - to parse JSON ...

Quick Tips: Sort Pipeline by Sales stages with Salesforce Tableau CRM (Einstein Analytics)

Quick Tips: Sort Pipeline by Sales stages with Salesforce CRM Analytics (aka Tableau CRM) Problem Statement While working on a recent change, we realized (a bit late) that the sales pipeline view shows sales stages in incorrect order. Ideally, you would want the pipeline view to reflect the stage in the same sequence as the sales process (for example Prospect, Propose, Negotiate, Close). Sales Path Sales Pipeline Initial SAQL q = load "opportunities" ; q = group q by 'StageName' ; q = foreach q generate 'StageName' as 'StageName' ,      sum ( 'Amount' ) as 'sum_Amount' ; q = order q by 'StageName' asc ; q = limit q 2000 ; Solution Approach Approach 1: Augment a field within the Opportunity dataset (CRM Analytics) to generate a new column for the Sales stage sequence This approach would be faster to deliver and has comparatively less change. However, as sales stages are changed/ updated it can result in the Tableau CRM da...

Quick Tip : Stop emails from Sandbox to unwanted domains

Designing a robust automated system is challenging yet profoundly satisfying. I'm sure most can relate, it is bliss to watch the system automatically doing all the work, like clockwork (quite literally). However, there can be some downsides as well. In our example, we wanted to ensure that in no way possible, an email is sent out to external recipients from a sandbox. Of course, the first step would be to mask the required data. However, there's still a possibility that real email addresses can make it into a sandbox. So, we devised a solution to absolutely restrict such emails from a sandbox. The solution is actually quite simple. This solution only targets email sent out manually by users in a sandbox. It does not address emails sent via apex, automation or third party tools Step 1 - Identify the test domain Identify a domain that you want to enable, to be able to send test emails from the sandbox. For example, if you are in XYZ Inc, you most likely want to send test ema...

Quick Tips: Queueable Apex : Loose Coupling with Chainable Interface

Queueable Apex : Loose Coupling with Chainable Interface Intro to Queueable Apex Time and again, we come across use cases where we have to either perform an extensive processing, which can breach governor limits, or we want to perform some work asynchronously for improved user experience. Queueable apex provides us a means to create an asynchronous job (An asynchronous job means a piece of work, which is scheduled to run in background, for e.g. you may want to do custom rollup calculations on opportunity save). Queueable apex is similar to future methods, wherein your future method is queued within a server queue. Server picks up the job and executes it, based on resource availability. However, there are some differences, quite notably: Queueable apex returns an ID for further enquiry Queueable apex methods can invoke external API (if Queueable apex class implements Database.AllowsCallouts interface) Queueable apex methods can enqueue other queueable apex jobs Say, we have a simple Qu...

Quick Tips: Setup Salesforce developer machine - without ADMIN Access

I presume, a lot of developers may be struggling to use right developer tools for salesforce development. It can be a further problem, if one doesn't have admin access on workstation, as lot of these tools just provide guidelines to install these tools. So this article covers setting up developer machine, without any installation process. In essence, you can setup a fully working Salesforce development environment on your workstation without any admin access. Note: This is logically part 2 of setting up dev machine without admin access. If you haven't gone through my earlier article of setting up SFDX on your workstation, without installation, I would recommend starting with this article Quick Tips: Setup SFDX Manually without Admin access What is Visual Studio Code? Visual studio code is an open source Interactive Development Environment (IDE) for programmers/ developers. It provides various capabilities and features for faster application development and is primari...

Tool - Google Play Comments Extractor

I was recently chatting with a childhood friend (rare thanks to COVID19, life is not so fast, for now) . He's a researcher and a Six Sigma expert. He mentioned he was facing a problem wherein he needs to extract google play app reviews. Now, being the programmer at heart (for good and bad), I thought it would be easy to crack. I stumbled upon various techniques and found a better/ faster way to get it done. Hereby sharing my journey. Challenge(s) Retrieve user reviews for google play app store for given app App is related to COVID-19 for India so have almost thousands of reviews being posted every single day. So, in short, large data volume Google play page doesn't make it easy either. Due to nature of minified javascript and dynamic event injection, user experience, it's a much complicated environment for data extraction Paging incorporates both infinity scrolling and button based next page functionality Solutions thought/ tried RPA - (I'm not an RPA expert, not yet) ...

Salesforce : Quick Tips: Mass Upload Roles

Recently, I was working on a project, wherein the organization was undergoing complete restructuring (merger, re-organization) and added to that re-vamp of CRM to improve Sales operations. As an integral part of data security. There was a need to review and redesign role hierarchy. Long story short, we ended up with a large list of roles (400+). We could have assigned someone to manually create these roles, but due to obvious reasons, I wanted to get this handled via script. I want to share a quick code snippet which can help you generate roles en-masse, without having to put in boring and gruesome hours of manually creating roles. [ Important: This solution will work when you have unique role names] SETUP Create the top level role manually at desired hierarchy level. For e.g. in our sample script, we used "CEO" role to build new hierarchy under CEO role DATA PREPARATION Firstly, as an approach of user onboarding we followed following steps: Created a l...

Quick Tips: Setup SFDX Manually without Admin access

We all have faced challenges while working in different enterprise environments, where there may be lot of controls/ checks/ red-tape to get by. In such situations, getting access to simple tools (even git) can take lot of time. Note: This tutorial is to be followed at your own risk, as it may not be complaint to your organization's IT policies. What is SFDX? SFDX is a command line utility for managing salesforce builds/ deployments. Being command line, it can be easily embedded to automation chains, to help build fully automated build and deployment processes. To get started, refer  https://trailhead.salesforce.com/en/content/learn/trails/sfdx_get_started Setup SFDX on Windows machine without admin access As you may have already realized, SFDX installation needs admin access to one's machine. Which may be a luxury a lot of developers may not have. So, i tried to provide a step-by-step guide to setup SFDX on your computer without any admin access Steps: Note:...

Time to Migrate from Salesforce Force.com IDE to VS Code

Image Credit: Visualstudio marketplace Why? In case you don’t know Salesforce is phasing out Force.com IDE (planned for June 2018) to promote newer IDE choices. There are already many IDEs out there to take Eclipse based Force.com IDE’s place. However, Salesforce is officially promoting Microsoft Visual Studio Code (aka VS Code) as official IDE. What is VS Code? VS Code is a platform-independent, light-weight and keyboard focused IDE for Salesforce (sorry for folks who loved menus and GUI). VS Code does have visual menus and options, however, using keyboard shortcuts is just do damn fast. There is surely some learning curve involved. But, once you get rolling, you would hate using mouse, as it takes a lot of work to raise your hand, move mouse, point and click and navigate, when you can just press “Ctrl + /” to comment current code selection. VS Code features Lightweight – In case  you have worked a lot with Eclipse, you might have noticed that it was a memory hog...

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 ...

Lightning: Generate PDF within Lightning Experience with Salesforce Data

Some time back I posted a solution to generate PDF from Lightning components using in-memory data. Post url: http://www.vermanshul.com/2017/07/lightning-generate-pdf-from-lightning.html It was developed for a specific scenario, wherein we need to generate PDF where: User interface is Salesforce classic Initiated via Lightning Component Data doesn't exist within Salesforce and is completely in-memory As complex and tricky this situation was, we did end up finding a stable and equally tricky solution. However, I realize that there are still lack of solutions (or maybe my search skills are downgrading) to generate and automatically download PDF document from Lightning Experience, without using any lightning components, wherein data exists within Salesforce. You can use the earlier solution in that case, but it will be an overkill. There are various solutions available to generate PDF from javascript. But, I still think the plain old method of converting HTML to PDF (via...