CheckMarx FLS Violations for Dynamic SObjects in Apex?
Question: In Salesforce Apex, handling objects dynamically using the generic SObject type allows for flexible and reusable code that can work across different Salesforce objects. However, this dynamic approach creates challenges for static code analysis tools like CheckMarx and PMD. For example, consider the following code snippet where QuoteLineItem records…
What Is the Difference Between Controllers and Extensions in Visualforce?
Question: Can someone explain the usage of controllers and extensions in Visualforce? When should we use a controller, and in what scenarios should we opt for an extension instead? Answer: In Visualforce, controllers and extensions define the behavior of a page, dictating how it interacts with Salesforce data and performs…
Hide Specific Buttons on Order Products Related List?
Question: Is it possible to control the visibility of the “Add Products” and “Edit Products” buttons on the Order Products related list? The only solution we have found so far is to hide both buttons by disabling the “Show list view action bar” option. We then created two duplicate related…
Automating Admin Approved Users Policy for Managed Package Apps
Question: I am building a Managed Package that includes an External Client App using the JWT Bearer Token Flow for authentication. One critical requirement is to ensure that the OAuth Policy of the Connected App is set to “Admin approved users are pre-authorized” automatically when the package is installed in…
Setting Lightning Datatable Width for Horizontal Scrolling?
Question When configuring a related list in a Lightning page, the rendered table has a <div> with a specific width derived from column widths, allowing horizontal scrolling. This prevents columns from being squished while ensuring users can scroll to view all data. In a custom Lightning Web Component (LWC) using…
Cloning Salesforce Objects and Projects to a New Org
Question: I have a Salesforce project in an existing Developer Edition org, and I want to create a new Developer Edition org where I can replicate all objects, layouts, and configurations from the existing org. Additionally, I need to make changes in the new org without affecting the existing one….
Calling Salesforce API from a Lightning Component?
I need to call the Apex Wrapper Metadata API from a Lightning component. The issue is that there is no native support for acquiring a valid API session ID from an @AuraEnabled method in a Lightning component’s Apex controller. Salesforce documentation suggests using a Named Credential to bypass this security…
How to line break on dataraptor formula?
Question: How can I insert a line break in a formula inside a DataRaptor? I need the formatted text to display properly in a document template. For example, I want the following formula to produce a line break: Is there a way to format the text so that it appears…
How to Delete Triggers or Classes from Production in Salesforce?
Question I’m encountering some confusion with deleting components in production. I understand that you can’t delete a class directly in production—you must remove it in your sandbox and then deploy the deletion using a package. However, when I delete a trigger in my sandbox, it doesn’t show up as a…
Can Custom Metadata Be Created in Test Classes?
Question: I have three questions regarding using Custom Metadata in Salesforce test classes: CRS Info Solutions provides top-notch Salesforce training with real-time projects, certification guidance, interview coaching, and a practical, job-ready approach. Answer: Custom Metadata records cannot be created in test classes. This is an intentional design choice by Salesforce…