How to create a formula specific to the running user in Salesforce?
Question How can I edit a field without triggering validation rules for a specific user in Salesforce? I have a requirement where a particular field should be editable by a specific user without causing the validation rules to fire. If you are wondering how to create a formula specific to…
Apex Callout Fails Due to SunCertPathBuilderException?
Question I am trying to make an Apex callout from Salesforce to an external system hosted inside a corporate firewall. The firewall forwards the request to a load balancer, which then routes it to the appropriate web server. While the callout works correctly when tested from SOAP UI, it fails…
What Are the Available Static Code Analysis Tools for Apex?
Question What Are the Best Static Code Analysis Tools for Apex? I’m looking for static code analysis tools specifically designed for Apex development. While the Force.com Security Source Code Scanner is a well-known option, it has the limitation of operating through a queue system, which can delay the analysis. I’m…
PMD Errors in WSDL to Apex Classes?
Question: I am building an AppExchange app and have used WSDL to Apex to generate a Metadata service class. However, the generated class throws PMD errors in the “Code Style” category. The specific errors include: Can I add this Apex class to the “False Positive” list while submitting my app…
Can the Metadata API Be Invoked from Apex?
Question: Is it possible to use the Salesforce Metadata API from within Apex? Can the Metadata API be invoked from Apex? Many sources state that Salesforce doesn’t allow callouts to its own web services from within Salesforce. However, other posts and resources suggest it might be achievable, especially for specific…
Why Do We Still Hack the Sidebar?
Question Despite advancements in Salesforce customization, many users still rely on sidebar workarounds. I’m interested in learning about the specific use cases, the challenges you’ve encountered, and—most importantly—strategies to address these issues using alternative, more official approaches. This discussion relates to methods like those explored in End of JavaScript Sidebar…
How to debug Apex code effectively?
Question: I’m new to Salesforce development and would like to learn how to debug my Apex code effectively. I often encounter issues in my triggers and controllers but struggle to identify the root causes. What steps or tools can I use to output debug information, investigate issues, and resolve errors…
Deserializing JSON with Reserved Words as Properties in Apex
Question How to Deserialize JSON with Reserved Words as Property Names in Apex? Is there a way to deserialize JSON into an Apex object using JSON.deserialize, even if some of the property names in the JSON correspond to reserved keywords in Apex? For example, when deserializing JSON with reserved words,…
Does setting a lookup field trigger a SOQL query?
Question: When working with Apex, a common question that arises is whether creating a new record with a lookup field will trigger a SOQL query. For example, if you create a new Contact and assign it to a lookup field of a Case record, does it result in a SOQL…
How to Clone a Record with Related Lists?
Question: I need to clone all Account records along with their associated Contact records. I am using the clone() method in Apex for this. Below is the code I have written: I am unable to figure out how to associate the cloned contacts with the corresponding cloned accounts. Since the…