Sunday, 14 May 2023

Quick tips to optimize your Salesforce org

 1. Keep your Salesforce org clean and organized by regularly archiving or deleting old data.

2. Use custom settings in Salesforce to store configurable settings that can be easily changed without modifying code.

3. Leverage the power of Salesforce reports and dashboards to gain insights into your data and make data-driven decisions.

4. Optimize your code by using SOQL queries to retrieve only the data you need, rather than retrieving all records and then filtering them in code.

5. Use validation rules in Salesforce to enforce data integrity and ensure that data entered into your org meets your business requirements.

6. Make your Salesforce org more user-friendly by customizing page layouts and creating custom fields and objects.

7. Automate repetitive tasks in Salesforce by using tools like flows to save time and increase efficiency.

8. Improve collaboration and communication within your team by using Salesforce Chatter to share information and collaborate on projects.

9. Use Salesforce mobile app to access your Salesforce data from anywhere, at any time, and keep track of your sales on the go.

10. Keep your Salesforce org secure by implementing two-factor authentication and regularly reviewing user permissions and access.

Best Practices For Large Data Volumes in Salesforce

 Your Org has tens of thousands of users, tens of millions of records, or hundreds of gigabytes of total record storage, have to follow best practices. Few Considerations:


Skinny Tables

Recommended to make your query fast. Important for batches taking long time to execute.


Indexes

Use index fields in where clause of Query. Multiple indexed field in query make it more faster. Even use Two-Column Custom Indexes. Two-column index is more efficient than single indexes on same fields.


Divisions

Partitioning the data of large deployments to reduce the number of records returned by queries and reports. For example, a deployment with many customer records might create divisions called US, EMEA, and APAC to separate the customers into smaller groups that are likely to have few interrelationships.


Mashups

One approach to reducing the amount of data in Salesforce is to maintain large data sets in a different application, and then make that application available to Salesforce as needed.


Deleting Data

Delete unused or unnecessary data. Use Bulk API's hard delete option, which allows records to bypass the Recycle Bin and become immediately available for deletion.


Search

When large volumes of data are added or changed, the search system must index that information before it becomes available for search by all users, and this process might take a long time.


Indexing with Nulls

Idea to reduce Null values, replace with NA or blank. Either use formula field to set value and index formula field.


API Performance

Add addition filter in rest API's query, so they don’t scan all salesforce data.


Sort Optimisation on a Query

Add a limit or sort order in query to make it fast and scan a limit of data only.

Field Trip (ZoomInfo Field Trip App Exchange tool)


Field Trip for Data Analysis and Data Cleansing Process

 

 Field Trip is a free tool on the Salesforce AppExchange that is incredibly simple to use and can empower admins and reveal what fields the team is using. Working through the fields is easier with Field Trip Analysis’ that run against specific objects. Running this analysis gives insight into the following:

  • Identify and remove fields that aren’t used
  • Make important fields required
  • Clean-up Page Layouts
  • Identify what data your users think is valuable

 

Field Trip mainly comprises of two objects namely,

1. Field Trip

2. Field Analyses

In the Field trip object, the user can give the name for field analysis, object API name and the criteria to filter the field for the record. Thus, it will list all the custom and standard fields of the selected object. It also provides the information of the percentage of the field utilization along with record count.

The Field Analyses object contains all the details like Field name, label, Type, PopulateOn and PopulateOn% in which we want to analyze. The Field Analyses (child) object has a master-detail relationship with Field Trip (Parent) object. So, the Field Trip Analyses object details are displayed in the related list of Field Trip object.

It also provides us the facility to generate the field trip reports monthly and current date (today’s date) report. With the help of this report, we can easily find and remove the unused fields of objects in the organization.

 

Pros: 

  1. Easy to analyze the fields for all custom and standard objects fields.
  2. Field trip reports help to analyze the fields which are not used consistently.
  3. No limitation to the number of records or fields to be analyzed.
  4. Analyzing the subset of records by adding filters is possible.
  5. Cleaning up the unused fields in the object.

Cons: 

  1. In the Field Trip, we can’t create the report based on the page layout.
  2. All reports should display all the fields listed on an object.
  3. If we need to analyze the subset of records, then we require an SOQL Query to be built to filter those records.
  4. Field Creation Date is not available on the reports. When a field is created, the field utilization % will be zero. It would be nice if we could pull based on the creation date of the field.

Conclusion : 

This Field Trip Application is very simple and easy to use.This is the best tool for data cleansing  and data analyses process.Report generation helps us to easily find and remove any unused fields in the object.

 


Monday, 1 May 2023

How to Call Apex from Flow using Invocable Action :

 To call Apex from Flow, you need to define the method in your Apex Class as an Invocable Method. And here are some of the rules that you need to follow when using Invocable Method:


  • The Apex class must be defined as public or global.
  • There can be only one invocable method in the Apex class.
  • The invocable method must be static and public or global, and its class must be an outer class.
  • There can be at most one input parameter to Apex method and its data type must be of list type.
  • The data type returned by the method must also be of the list type.

Faster Account Sharing Rules Recalculation (Spring ’23)

 Salesforce provides implicit sharing between a parent account and its child objects (cases, contacts, and opportunities) and creates implicit child share records on these objects.


With Spring ’23 release it is changing the way that automatic sharing calculation works behind the scenes for case and contact objects. Salesforce will no longer store child implicit share records between accounts and their child case and contact records. Instead, the system dynamically determines whether users can access child case and contact records when they try to access them. Not storing the child implicit share records speeds up ownership and sharing rule recalculation for accounts.


To enable this feature, please contact Salesforce Customer Support.


References :

1.https://www.linkedin.com/pulse/faster-account-sharing-recalculations-larry-tung