I have total 6+ years of experience all in Salesforce. I have knowledge in Integration, Rest , soap Apis, admin, customization , JSON , SOQL query, Lwc, Flows, Trigger , synchronous and asynchronous apex , apex code , governor limit. Vlocity, Omnistudio
Sr. Software Engineer
Tech MahindraLead Consultant
INFO-TECHNO
Apex

Apex Data Loader

Java

BitBucket

Workbench

Azure Pipelines
Hi. I am. So I have overall 6 plus years of experience in the Salesforce industry. I am a Salesforce software developer. So, currently, I'm working here. I recently joined in February 2024. Before this, I was working with Tech Mahindra, where I was a senior Salesforce developer. Here, I joined as a tech lead. The major work I'm performing here is on the Omni Studio packages. We have a big client like Synchrony. We're working for Synchrony, our client, and we're migrating data from their audio system to our Salesforce system. We're performing this via Salesforce Omni Studio. Like, we're creating Flexcards, Omni scripts, and integration procedures. These are things we're creating here at BillerSoft.
How do complex SQL queries that are causing CPU time limit triggers? So, for this, we can create a SQL query by adding a limit key keyword in the last so that we can specify how much time how much records we want to fetch through this circle query, and we will take one more thing via writing a trigger or a SOQL query that we are avoiding to write a SOQL query inside of all loop. So, instead of writing a query inside of all loop, we can use a for each loop of query, like account: data select ID from account where limit is. So that will work more efficiently. So, it will reduce the limit error. As we know, there is a synchronous limit of SQL queries. That will be 100 SQL queries we can write in a synchronous way. So we can do these all things to avoid the limit error.
What is the process of debugging a failing used in our Apex class? So, basically, we'll check what the error is coming in the logs. Then we'll try to debug that log by printing the SQL query. Either we're getting the government limit of 101 or there is a restriction of that particular field which we are trying to access, or there is a permission-related issue in the software query. So, we need to rectify those things or go through the object on which data has been written, and we'll check what type of provision is given to that particular circle query if it's run in user mode. Basically, all Apex code runs in system mode, but we can modify this in user mode as well. So we'll check those things to avoid these kinds of failures in Apex. Yeah.
Salesforce app. How do you recommend whether to use Salesforce standard controller or custom Apex controller? So, basically, it's better to use a handle class. Salesforce handle class, Apex handle class. To avoid the complexity of the code. And, if we're talking about the trigger, there is also a trigger handle class as well. So, it's better to use a trigger handle class and write a logic in the handle class and call it from the main trigger. This will allow us to perform the code coverage of the particular handle class separately. This will help in test writing and testing, and it will also help to deploy those codes as well. Because deployment is only possible when we have sufficient code coverage, which is 75%. Minimum 75% is required. So, we'll make sure that the code we have written should be covered by the test class with a minimum percentage of 75%. This is the fun part, where we aim to meet the 75% criteria. But here, we are covering up to 85%. Previously, in Tech Mahindra, they also considered 85 to 90%. These are the things we are doing.
What testing strategy would you use for a complex sales process, for instance, with multiple custom applications? So, I'm not sure you're talking about, like, Salesforce testing in the context of, we have a testing scenario that's different from what we used to do, where we used to test our service with the test data we created in the org. If we've developed something, then we should know what all the test data is required to run this particular service and what all scenarios we can test. There are a couple of scenarios which we can configure, like positive and negative scenarios. We should identify, for example, here in what we're doing, there is a Salesforce org, which we're exposing to PASER, a third-party service. PASER is trying to access the Salesforce API. We're exposing our endpoint URL, and we're testing through Postman, our endpoint URL, that in that endpoint URL, we're customizing the body. In the body, we have multiple validations, which we've written in the Apex class, like phone pay validation, zip code validation. That zip code must be a number only; it should not be greater than five digits, or it should not accept any character or any other value than numbers. So these are validations we've entered. If we're trying to enter, through Postman, some other things instead of numbers, then it should fail, and it should throw a message, which we've configured in the Apex class. So, we've tested multiple scenarios, and we're getting the proper response, with what we've developed. So, yeah, these kinds of things we've tested. In the Apex class, also, we have a test class for the particular Apex class. In the test class, we follow some best practices, like we need to write maximum number of test methods. If we're trying to make an HTTP mock test call out, then we need to write it in the test start block and test end block between this. So, yeah. In this block, the governor limit will increase, and other than that, there should be a test set of methods, and every method should be a test method, or have the isTest annotation, in every method. So, these are all things we should use.
I incorporate the solid principle of in designing the reusable Apex class for the Salesforce application. It's better to use existing classes which are already written in Apex. I also prefer this. If we have any generic rapper class, which is written, a generic mock test class or a generic class to get the endpoint URL or to get the response body or to modify the response. This is the best practice to use those via creating an instance of that particular class and that method. It will increase the reusability of the code, and it will not take much space. While we're deploying that code, just refer to that particular test class, and it will be easy to deploy. It's better to use the existing Apex class instead of creating a new one.
Developer might be encountering the owner limit when querying large dataset because of the complexity of the query and the large number of records in the database, possibly exceeding the allowed limit of 50,000. An optimal optimization to prevent hitting this limit is to use pagination or batch processing. So it might be possible that in the database, we have more than 50,000 or 1 lakh accounts. So, it's better to write this query inside a loop for accounts, instead of accounts, just write this select ID name from contacts from accounts. So what it will do, it will take 2-100, 200 chunks of accounts, and it will not cover much heap size like a heap. So it will automatically remove from the heap, so it will not encounter any heap size issue. Yeah.
Code snippet that is meant to update a contract, contact recall, and then comes custom field, custom status changes to determine why the stinger might, may not have. This is some trigger after a bit. So list of contacts. If account custom field. So update the content report when the account doesn't feel changes to I need to check. Not a code to trigger dot org, this is a dot ID dot custom field setting status. Here, this for contact colon acc.context. Here, we can't directly, context subject. We can't directly write a for this loop on a c z dot contacts. We need to write it in a separate, like, SOQL query we need to configure. We need to track all the context related to that particular account. So in this particular code, we need to fetch first ID of that particular account, which is going to which on which this custom status is changing. Then from that ID, based on that based on that particular ID, we need to fetch all the contacts, and then only we need to update the record. So this must be the answer. We need to write the separate query for the contact based on the ID where ID in colon, we need to fetch first set of IDs. ACC dot ID, we need to fetch all the IDs in the sets. Then from that set, we need to capture all the context, related context, and we need to update those contacts.
Class. So, here, we have multiple things. So to enforce sharing rules in the Apex class, like using with sharing or without sharing in the class level. Other than that, we have very encryption as well. With security enforced as a keyword, which we need to append in the last of the SOQL query. Though, it will check the logged in user who is performing this particular task or executing this Apex class has all the field access which is written in that SOQL query. So, it will check all the permissions of the particular user, then only it will execute. If a user doesn't have any permission of that particular field which are already mentioned in the SOQL query, then it will throw an exception. So, yeah, basically, with security and the 'force' to keyword.
So we can write a query to generate a report that provides insights into property sales trends. We can write a query or use Salesforce inspector. There, we can write a query for whatever data we actually require. Then, there are some buttons below that. You can convert those files into Excel format or CSV format. We can directly copy those files and migrate to the Excel format. From there, we can create this report or not. So if this is the question, then I think this is the way we can do. Other than that, how would you use software to generate reports? This is coming to mind right now. So yeah.
Sales was triggered to handle bulk operations in property management workflow. So, this is as the question suggests, how we can optimize Salesforce trigger to enter bulk operation. So, trigger must be bulkified as well. It is a best practice to write a trigger. To bulkify it, we do not need to hard code any value or work for a particular record, which are going to be inserted. We need to think, if there are multiple records or multiple records are going to be inserted or updated simultaneously, then this piece of code should work. So, while writing a trigger, like for a contact c: trigger.new, then it will take all the contacts which are going to be updated, deleted, or inserted. We have to perform all the activities which we need to do. Either we need to perform it on the parent object, like account, or if we have to perform any action on the contact itself, then we need to do it in the before context. Or if we are performing an action on the parent, then we need to perform in the after context. So, these are things we need to keep in mind. To bulkify, we need to work, if we are fetching all the queries, then we should also filter it out where ID: in this particular list or set of IDs, so that it will capture all the IDs which are going to be inserted or it will take multiple IDs. And we can work on that particular IDs in a single operation. Thank you. Thank you very much. I think I have finished all the things.