Author: Dhanik Lal Sahni

With over 18 years of experience in web-based application development, I specialize in Salesforce technology and its ecosystem. My journey has equipped me with expertise in a diverse range of technologies including .NET, .NET Core, MS Dynamics CRM, Azure, Oracle, and SQL Server. I am dedicated to staying at the forefront of technological advancements and continuously researching new developments in the Salesforce realm. My focus remains on leveraging technology to create innovative solutions that drive business success.

We mostly have requirements to upload files in file storage servers like AWS S3 Server, Dropbox, Google Drive, etc. This post will help in uploading files to S3 Server. We will use named credential to upload file in S3 server. Steps for uploading file in S3 Server using named credential Create a named credential for AWS CredentialCreate an apex class to upload fileTest functionality 1. Create a named credential for AWS Credential Create a named credential with Authentication Protocol as AWS Signature Version 4. AWS Signature Version 4 (SigV4) is the process to add authentication information to AWS API requests…

Read More

Integration with external system is very common requirement in Salesforce application. For this we can go for declarative external service or create apex class for each type of integration. Declarative External Service can only work when OpenAPI schema is available so for other cases we have to go for apex class. In this post we will create a generic apex class for calling external system which can used with named credential also. For creating generic class we have to add feature to get different parameters like header parameter, request parameters, endpoint urls, named credential information etc. We will also add…

Read More

LWC are custom HTML elements built using HTML and modern JavaScript (Ecma Script) and stylesheets. LWC is built over core Web Standards and Salesforce has used shadow DOM concepts for securing page data. As LWC is built on HTML, there could be session tempering over the internet. We can use Health Checkup for finding inactive session security setting in Salesforce application. Salesforce provided many technique for securing sessions. Let us explore top 5 session setting which can be applied for securing Salesforce application specially for LWC. 1. Require HttpOnly Attribute An HttpOnly Cookie is a optional attribute added to a browser cookie that…

Read More

Serialization is a process of converting an apex object into stream of bytes so that it can be transferred over a network or stored in a salesforce record. Deserialization is the exact opposite – which convert bytes of stream into object. This serialization/deserialization process should be considered properly while implementing. As this is extra layer over object which can add extra time for application load/performance, we should not always consider it blindly. This should only have implemented where it is required.  There is other problem with this serialization/deserialization process is, it can insecure for application. See article of OWASP for insecure…

Read More

Many clients require verified phones for their business use cases. Verified phone helps business to give their services to valid customers. Below are some reasons why Phone verification in Salesforce is required by businesses In Salesforce we can easily validate mobile/phone number using regular expression but system will not help in verification of phone number. There are many API/products available for phone verification. Here are some API which can do phone verification I am using Veriphone for verifying phone in this post but we can use any one based on license availability. Use Case: Account object is storing customer information.…

Read More

Apex code coverage is important when we move code from one Sandbox to other or production environment. In sandbox environment, we can move code without minimum code coverage but for production, we need minimum 75% code coverage for custom apex code. Checking Org’s Apex Code Coverage: We can check code coverage using Apex class screen. Checking Individual Apex Class Code Coverage: We can check individual apex code class coverage from Developer console by running test class. It will give result with code coverage percentage with each class. We can check this report on screen but we can not export or…

Read More

A single Salesforce orgs can be utilized by multiple clients. If our clients are calling Salesforce APIs for data upload, data creation etc or we are calling client system to update data, org’s daily API limit consumed. This API limit should not exceed to org’s daily API limit. We should monitor API limit so that our application stay functional. This post will explain about multiple ways to get API consumption limit. 1. System Overview Page System overview page shows usage data and limits for organization and it also displays messages when you reach 95% of your limit (75% of portal…

Read More

In some real-time use cases, we need to convert the date time of one time-zone to the date time of another timezone. This post will show how to convert Datetime of one Timezone to Datetime of another Timezone. Apex for converting time in a different timezone This TimeZoneService class will convert datetime of one timezone to another timezone. To convert the timezone, we need the correct TIMEZONESIDKEY. Here is the complete list of supported timezone in salesforce. If we will use an incorrect or not supported timezonesidkey, then we will get GMT timezone information. Let’s use the above service class…

Read More

Timezone is very important in some business use case specially for calling to customer, doctors or patients for different needs. Call center agents or user should call these customers on their preferred time and their timezone. By default we can not get timezone based on zip code of customer. We can get these information using API like Smarty Street and zipcodeapi. In this post, I am using zipcodeapi to get Timezone information. We have to create apex class to call this API and we are showing that in LWC component. Based on your requirement, you can use use this information.…

Read More