Tag: apex

  • How to Disable Lightning Component Cache in Salesforce?

    When building Lightning Components in Salesforce Lightning Experience, developers often encounter a situation where the changes made to their component files — especially the JavaScript controller or helper files like custom_componentController.js or custom_componentHelper.js — don’t immediately show up after saving and reloading the page. You might have noticed that even after performing a normal refresh,…

  • How to navigate in lightning out?

    When working with Lightning Components embedded inside a Visualforce page, a common challenge arises when you want to perform navigation actions such as redirecting to a record page or opening a new record form. Normally, Lightning provides navigation events like $A.get(“e.force:navigateToURL”) and $A.get(“e.force:createRecord”). However, these events only work when the component is hosted inside the…

  • How to Display Parent Fields in ?

    When working with the Winter ’18 <lightning:datatable> component in Salesforce, many developers face an issue when trying to display fields from parent objects. The component binds data correctly for direct fields of an object, but when you try to display fields such as Account.Name from a related object, the values do not appear in the…

  • How can I install a managed package using Salesforce DX CLI?

    When working with Salesforce DX and Continuous Integration tools like Travis CI, Jenkins, or GitHub Actions, a common requirement is to install managed packages into scratch orgs before deploying your source code. This is especially important if your Lightning components, Apex classes, or other metadata depend on packages published on the AppExchange. Without installing those…

  • Can Salesforce Report Data Be Accessed Programmatically?

    Question It is common for developers to wonder if existing Salesforce reports and their data can be accessed directly in Apex, instead of replicating the report logic with SOQL queries. Manually writing SOQL queries would require code changes every time the report is updated, which is not efficient. So the question is: is there a…

  • How Can I Create a Chatter File Using Apex?

    Question In the Chatter tab, I can navigate to “Files” and upload a file without attaching it to any specific record. I want to achieve the same functionality purely through Apex. How can this be done? Answer Yes, you can create a Chatter File (Salesforce File) using Apex by working with the ContentVersion object. Salesforce…

  • How to Pass a Variable from One Apex Class to Another?

    Question I have an Apex class (MyCTIExtensions) that retrieves a phone number and stores it in a static variable (phoneNumber). When certain conditions are met (cases.size() > 1), the class calls a Visualforce page. The Visualforce page’s controller (FlowRedirectController) is supposed to retrieve this phoneNumber and use it to construct a URL for a Flow.…

  • How Can I Delete Triggers and Classes from Production?

    Question I was told that classes and triggers cannot be deleted directly in Production. Instead, they must be deleted in a Sandbox and then deployed as deletions. However, after deleting a class in Sandbox, it does not appear as a deployable change—red or otherwise. Do deleted triggers/classes show up somewhere else for deployment? Does this…

  • How to Retrieve Tabs, Apps, and Apex Classes in Salesforce?

    Question I am using sf project retrieve to pull metadata from my Salesforce Dev Hub into my local project. My package.xml retrieves Apex triggers but does not fetch custom applications (Lightning apps), custom tabs, Apex classes, or custom fields. How can I modify package.xml to retrieve them? Answer In Salesforce, retrieving metadata using sf project…