Fitness freaks always talk about carbs, protein and fats. This blog will show the carbs, protein, fats and calories of fruit or vegetable using Spoonacular API.
Author: Dhanik Lal Sahni
Apex code is mostly run in system context so it is not considering current user’s permission. It is creating data integrity issue. Using  with sharing keywords when declaring a class enforces Sharing Rules, but not object and field-level permissions. In Spring 20 release some security enhancements are added to enforce object and field-level permissions. Using Schema Methods We can now use Schema.DescribeFieldResult to check current user has read, create, or update access for a field. For example, if we want to check that logged user has read access on PersonEmail field of the Account Object, we can enclose the SOQL query inside an if block that…
Salesforce Queueable Job is very important for long running data updates. We must notify when particular data update is finished. This feature was not available till winter 2020 release. Salesforce has introduced transaction finalizer in Spring 2020 release. This will help us adding any post completion logic for Queueable Job. Finalizers Finalizer is interface which need to be implemented in a class to add post action. It’s execute method takes FinalizerContext as parameter which will give current executing job detail. So, we can attach the same Finalizer to multiple Queueable jobs and utilize a consistent, common codebase for post-async actions. Like in…
This post is related to top 20 questions related to Salesforce security implementation. We have another post related to interview questions for salesforce integration and asynchronous apex. 1. What is Phishing? Ans. Phishing is a social engineering technique that attempts to acquire sensitive information such as usernames, passwords, and credit card details by masquerading as a trustworthy entity in an electronic communication. Phishers often direct users to enter details at a fake website whose URL and look-and-feel are almost identical to the legitimate one. 2. What is Malware? Ans. Malware is software designed to infiltrate or damage a computer system without the…
Community Portals are very important for business to engage customer and partners. Salesforce provide community cloud to make these portals using point and click as well as advance custom lightning portals. As per part of community cloud, we mostly required to show files to our customers. By default files as only accessible to internal user. These are not accessible to external user (community users are external users). This post is explain how we can show files in lighting community portal. Below permission is required to set for community users Create a custom profile by cloning standard Customer Community Plus profile…
Recently we were having a requirement for getting text from audio or video file. These audios were majorly from customer calls with agents. Once we get text from audio files , we can review those conversions. We can check how agents are discussing with customers. This will increase customer happiness. There are many solutions available for converting audio/video file to text. Some of major solutions are below Google Speech API Amazon Transcribe Microsoft Speech API Watson Speech to Text This post is using Google Speech API to transcribe audio file into text. This audio file is attached in case record. …
How to Download Files from S3 Server using Apex and Lightning Component Downloading or reading files from S3 server is required most of time in our Salesforce projects. This post will explain how we can download files from AWS S3 Server and show using Lightning component. We can download files using two ways. Using S3 API in Apex and Lighting Component Using AWS Java Script SDK in Lightning Component 1. Using S3 API in Apex and Lighting Component To download file using Apex, we have to use HTTP Callout with uploaded file URL. As in our last post How to Upload…
Top 20 Salesforce Developer Interview Questions This post has the top 20 questions related to Salesforce integration and asynchronous apex. Asynchronous apex and integration are very important for processing large data sets. Salesforce Developer Interview Questions 1. Why do we need integration in Salesforce? Ans. Integration comes into the picture when some interaction is required from an external system. Let us take an example, we want to validate the address of the account record. This can be done using Google address validation or smarty street API integration. 2. What are the types of integration patterns in salesforce? Ans. Pattern Description…
How to Upload Files to S3 Server using Apex Uploading and Reading files from AWS S3 server is one of frequently used requirement in Salesforce project. This post will give complete detail, how to write files of current record to S3 Server using Apex. Important information about writing file to S3 Server. We require Write permission on bucket If multiple files with same name saved on destination, then it will override last uploaded file. Use Content-MD5 for transport security We can use AWS inbuild encryption or custom encryption logic also work while writing file to S3 server We should provide access level…
Factory Design Pattern Factory Design Pattern is one of important design pattern which falls under Creational Design Patterns of Gang Of Four. This pattern takes responsibility of creating object. Factory Design Pattern implements loose coupling by implementing abstract entities rather than concrete implementations. Above diagram shows a common scenario using an example of a service request factory which is able to generate two types , case creation and address changes for any account. Actual implementation for case creation and address changes is done in respective classes. ServiceRequestFactory will return object based on service type. Implement above Scenario in Salesforce Apex: 1. Create…