Skip to main content

Code coverage for salesforce low code tools : Workflow rules , Process builders and Flows

Apex code coverage indicates how many executable lines of the code in your apex classes and apex triggers have been exercised by test methods. To deploy Apex or package to Salesforce AppExchange, test class code must cover at least 75% of your Apex code, and those tests must pass.

In salesforce user interface we can check the organization code coverage for APEX classes by navigating as follows 

Setup ==> search ==> Apex Classes ==> Apex Classes Page TAB. 



We can also view the code coverage for Apex code under developer console:



There might be business requirement to note down the code coverage for functionality developed using low code tools. Salesforce low code tools development includes Workflows Rules, Process Builders and Flows .To evaluate code coverage for low code tools we can use below set of steps

  1. Login to salesforce org
  2. Open developer console from salesforce UI
  3. Go to the query editor TAB and enable the option ' Use Tooling API '  . This options will allow us to run SOQL queries for objects we want to .  
  4. Run the below query which retrieve rows from sObject schema 
SELECT Id, ApexTestClassId, TestMethodName, FlowVersionId,  NumElementsCovered,  NumElementsNotCovered FROM FlowTestCoverage

The output of the query will be as follows:


The main columns to focus to calculate code coverage are :

NumElementsCovered

NumElementsNotCovered

For Example the query retuned below values for following columns, the code coverage value would be as follows :



Comments

Popular posts from this blog

TrackWise Digital - DMS Application - How to Override and make changes to locked EFFECTIVE Document using Flows and Invocable method.

Document management systems (DMS)   is one of the known solutions pharma organization use to manage their internal quality processes and store/ track all documentation related to quality. By using cloud-based product we have advantages over documents getting lost, outdated version rendered to stakeholders, irregular audit tracking like who made the changes and when. These qualities are necessary for good quality software as part of internal adulting process. The document are uploaded into the DMS system by DMS administrators. The document must go through a pre-defined workflow review process before it is made EFFECTIVE and made available for end users for training reference. The workflow lifecycle for DMS workflow approval cycle includes a) Draft, b) In Review, c)Under Approval and d) EFFECTIVE. Once the document is EFFECTIVE, the document is locked for further editing. The document is later used for internal training and can be printed and shared with internal users for performing...

Salesforce Rebate Management Tool – Streamline Your Rebate Process

Salesforce Rebate Management tool is a powerful tool for businesses to streamline their rebate process. It helps businesses to manage their rebate program more efficiently by automating the entire process. The tool helps businesses to provide rebates to their customers based on their purchases, which ultimately helps businesses to increase their sales and revenue. In this article, we will discuss the benefits of using Salesforce Rebate Management tool and how to set up benefit mapping. Benefits of using Salesforce Rebate Management Tool 1. Automate your rebate process – The tool automates the entire rebate process, from creating rebate offers to calculating payouts, which saves time and eliminates manual errors. 2. Increase customer loyalty – By offering rebates to your customers, you can increase their loyalty and encourage repeat purchases. 3. Improve sales performance – The tool helps businesses to increase their sales performance by incentivizing their sales team to sell more pro...

TrackWise : E-Signature doesn't work

If you are on Trackwise Digital [TWD] Platform Summer 23 or highier and come across an error ' E-Signature doesn't work ' for username / password with OAuth connected app . Check the Login History of the user and confirm you see the error ' Username-Password Flow Disabled ' . If this happens then you need to enbale the ' OAuth Username-Password Flows ' which will be disabled by default for Summer 23 platform or highier . Steps to enable : 1. Setup ==> search ==> OAuth and OpenID Connect Settings 2. Enable - Allow OAuth Username-Password Flows Reference https://lnkd.in/giVuzGbs

Salesforce flow validation to check if a record has file attached in files related list

Flow is part of salesforce flows which collects data via user screens from business users inside your salesforce organization or we call as ORG hereafter .  Salesforce flows comes in two flavors  a) Screen flows  b) Auto launched flows  Screen flows are used in business scenario where data is collected from users screens. Auto-launched flows runs in background which are triggered or launched automatically based on certain system conditions . That is a bit of basis check  on flows .