How to Unit Test Callouts in Apex?
Question: How do I unit test Apex code that includes a SOAP or REST-based callout or indirectly calls code that makes a callout? I am getting an error saying that callouts are not supported during test execution. Answer: Salesforce enforces test isolation, which means you cannot make REST or SOAP…
How to Show Last Activity Date on Account Page?
Question When running an Account report, I can include a field called “Last Activity Date.” However, when I try to add this field to the Account detail page, it doesn’t appear as an option. I checked profile permissions but couldn’t find any related settings. While I found documentation explaining how…
How Can I Redirect or Finish a Screen Flow from the First Screen?
Question: I have a screen flow with only one screen that is triggered by a button on the Incident List view. The flow asks the user whether they want to change the owner to a group or user. I’ve implemented a custom LWC with two buttons—“Next” and “Cancel.” The “Next”…
Approval Process Field Update Formula Issue?
Question: I need help creating a formula for an Approval Process to update the Pending Approver field upon initial submission. The requirements are as follows: Here is the formula I attempted, which is not working as expected: The issue is that the formula appears to return results prematurely, preventing it…
Efficiently Generate a Set from List
Question: I have a SOQL query that returns a List<SObject> structure, and I need to convert this into a Set<Id> to pass to another method. The method’s signature cannot be changed, so I must provide the data in the required format. What is the best way to achieve this conversion?…
How to Debug Visualforce and JavaScript?
Question: How can I debug issues in my Visualforce pages or custom JavaScript code? I often encounter problems like partial page refreshes not working as expected, or custom JavaScript behaving unexpectedly. As an inexperienced web developer, what tools or techniques can I use to debug these problems effectively? Additionally, how…
How to Test Apex code with Field History Tracking?
Question In Salesforce, testing Apex code that relies on field history tracking can be challenging because field history records are not automatically created during tests. This issue arises when the code queries history records, such as those for custom objects. Although the code works in production, the tests fail because…
How to Access _MobileAddress and _MobileSubscription?
Question I am working on managing MobileConnect Contacts and have discovered that the old _SubscriberSMS Data Extension has been deprecated. It appears that the relevant Data Extensions for this data are now _MobileAddress and _MobileSubscription. From what I understand, _MobileAddress contains contact details, possibly using MobileNumber or SubscriberId as the…
How to fix insufficient access rights error?
Question: I am encountering the following error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id: [] The scenario involves inserting an Opportunity and its related Opportunity Line Item from a Visualforce page using an Apex controller. When logged in as a user with the “Authenticated Website” license, the error occurs. However,…
How to Style Inner Elements of Standard LWC Components?
Question How can we target inner elements of standard Lightning Web Components with CSS? Answer In LWC, styles are scoped to the component itself, which makes it difficult to style inner elements of standard Lightning Web Components like lightning-textarea. This is because LWC uses Shadow DOM-like encapsulation to prevent styles…

