Skip to main content
16 votes
Accepted

How to sort SET in apex

You can't sort a Set, as Sets are, by definition, unordered. Convert it to a List first: List<Time> timeList = new List<Time>(timeSet); timeList.sort();
sfdcfox's user avatar
  • 495k
13 votes

Supported Programming Languages in Salesforce

Backend You cannot use other programming languages for backend development than Apex, but have in mind that within Salesforce you can use a great number of APIs, from which the most popular ones for ...
Przemysław Długoszewski-Tamoń's user avatar
11 votes
Accepted

How to refresh the specific Lightning component not the lightning page

If you are refreshing the component from the context of a parent, you don't need to use an event - you can expose a method to the parent and get it to call that. If you are refreshing the component ...
Caspar Harmer's user avatar
10 votes
Accepted

Is there a lightning event that a component can bind to on screen rotation?

You can use the onorientationchange event to do something. The code would look like this: ({ init: function(component, event, helper) { window.addEventListener( "...
sfdcfox's user avatar
  • 495k
10 votes

Supported Programming Languages in Salesforce

No. All server-side code must be written in Apex.
sfdcfox's user avatar
  • 495k
9 votes
Accepted

Error: No Lightning Component Quick Actions are available for your organization

The Lightning component you wanted to show in quick action should implement force:lightningQuickAction or force:lightningQuickActionWithoutHeader interface. Add the force:lightningQuickAction or ...
Praveen's user avatar
  • 10.1k
9 votes

How to refresh the specific Lightning component not the lightning page

You are not supposed to refresh one specific component, as the component firing the refresh is not supposed to know what other components are on the page. Instead, create and fire your own event, and ...
Fabien Taillon's user avatar
8 votes
Accepted

How to set UI Theme in Test (Salesforce1)?

One solution is to just use a @TestVisible static Boolean flag. It's a common, simple control mechanism: In your code: @TestVisible static Boolean isInSalesforce1 = UserInfo.getUiThemeDisplayed() == ...
Adrian Larson's user avatar
  • 150k
7 votes

Pagescroll not working in Pages which are navigated to a lightning component in Salesforce1 app

An equivalent to force:navigateToComponent will be released GA as a public API, it's under the category of "Global Components" that is scheduled for this coming release "Winter 17": http://web-auth....
JF Paradis's user avatar
  • 2,460
7 votes
Accepted

In SOQL, Difference between passing list of id or List of sObject in WHERE IN clause

It's probably a wash. If your number of parents is very large (~49k records), using Set<Id> is marginally (~16%) faster. For me, the List<SObject> merge query took on average .208s and ...
Adrian Larson's user avatar
  • 150k
7 votes
Accepted

Expose LWC in Mobile App

From the documentation of Form Factors, If you don’t define , the component supports the form factors that the page type supports. However, we recommend defining for each page type. App ...
salesforce-sas's user avatar
6 votes
Accepted

AWS Signature Version 4 IAM authorization

Salesforce now has native support for AWS v4 signature generation. Create a new Named Credential for the service endpoint, for example: Name: S3 URL: https://s3.us-east-1.amazonaws.com Identity Type: ...
Matt and Neil's user avatar
6 votes
Accepted

Get user id from Javascript

You can't use "bind expressions" in JavaScript. You have to actually use normal strings. This should be approximately correct: setTimeout(function() { var query1 = sforce.connection.query("...
sfdcfox's user avatar
  • 495k
6 votes
Accepted

Showing classic page instead of lightning page when i open an Opportunity from list in salesforce1/Mobile

If you have override visual force component instead of standard one. Open view and click on a override VF component. Steps-> Setup-> Object Manager -> Opportunity Find override vf page in Action and ...
Sanjay Singh's user avatar
6 votes
Accepted

Show decremented character count of textarea dynamically as and when user enters

You can actually use binding to achieve it : <aura:attribute name="textAreaValue" type="String" default="Default text"/> <lightning:textarea name="myTextArea" value="{!v.textAreaValue}" ...
Roman's user avatar
  • 663
6 votes

Salesforce Lightning: How can i get session Id of current user in Salesforce lightning component?

Take a look into the document mentioned here .You cannot use the session obtained from userinfo to make REST API calls using the @AuraEnabled methods for Security reasons . Salesforce recommends ...
Mohith Shrivastava's user avatar
6 votes
Accepted

Salesforce Lightning error handling

It's a known issue. You can find the details here. Custom error messages not displayed in Lightning Experience when uploading files Summary:- Server error messages (added via addError() for ...
sanket kumar's user avatar
  • 15.4k
6 votes

Supported Programming Languages in Salesforce

Shortly(Dev preview feb 2020) we will get Evergreen function that will allow you to write nodejs and Java code in Salesforce org. https://developer.salesforce.com/blogs/2019/11/introducing-salesforce-...
Pranay Jaiswal's user avatar
5 votes
Accepted

Dynamically add and remove rows in lightning

I have done a simple component which display contacts list which involves two components 1.ContactList - Parent (Fetches the contact details) 2.ContactListItem - Child (Display individual contact ...
Praveen's user avatar
  • 10.1k
5 votes
Accepted

How to Query all opportunities ids from account

Most efficient: Set<Id> childIds = new Map<Id, Opportunity>(ao.Opportunities).keySet(); You can also loop through them: for (Opportunity child : ao.Opportunities) { // ... }
Adrian Larson's user avatar
  • 150k
5 votes
Accepted

Enabling Lightning LockerService Security says - Helper data undefined

The problem in your code is the use of this keyword inside of the action's callback function. Every JS function has a this,and the value of this is determined by how a function is called and it ...
Praveen's user avatar
  • 10.1k
5 votes

HIghcharts error #16 while changing Salesforce1 tab

This is happening because of multiple reasons. Plugin file that is not fully compliant on Strict mode (with Lightning Locker Service Enabled) Check inside the HighCharts Script to avoid multiple load ...
Pintu Francis's user avatar
5 votes

In SOQL, Difference between passing list of id or List of sObject in WHERE IN clause

There is no difference in both statement except using an extra variable. If you need only Account id for other purpose then store the Account Ids in list/set for further use. if you don't need then ...
Ratan Paul's user avatar
  • 22.7k
5 votes

PDF file download in Lightning

If you use Files or content related object there is a simple event with new lightning namespace which can be used Here is a sample quick POC <aura:component implements="force:appHostable,...
Mohith Shrivastava's user avatar
5 votes
Accepted

Json2Apex implementation issue

That's because it's not properly formed JSON. You're missing the outer square brackets ([]) that indicate it's a list. Correct [ { "firstName": "John", "lastName": "Doe" }, ...
Adrian Larson's user avatar
  • 150k
5 votes

Why 'slds-scrollable' class is not compatible with s1 mobile?

There's already a known issue on this, you can probably click "This Issue Affects me" button if you're interested. You can use newly added Lightning component in the Winter '17, ui:scrollerWrapper ...
SE_User's user avatar
  • 2,283
5 votes
Accepted

How to use sforce.one.navigateToURL on VF page?

You are redirecting to a null value (OpportunityId is not defined). However, you should not create a link like this anyways; instead, use editRecord: // Merge opportunity Id into a string, then ...
sfdcfox's user avatar
  • 495k
5 votes

Does VS Code works for Non Salesforce DX?

You can use MavensMate-VisualStudioCode, but it involves installing MavensMate. You might also search the Marketplace for other Salesforce-related extensions; many of them do not use DX, and at least ...
sfdcfox's user avatar
  • 495k
5 votes
Accepted

Does VS Code works for Non Salesforce DX?

Installing DX won't prevent you from using MavensMate with VSCode. I've installed the following extensions to VSCode: Apex Code Editor for Visual Studio Code Apex Debugger for Visual Studio Code ...
torpy's user avatar
  • 355
5 votes
Accepted

Custom button or link in lightning tree

lightning:tree does not support that type of feature. You would want to use a lightning:treeGrid instead, which allows you to do things like specifying an action column where you could add the menu ...
sfdcfox's user avatar
  • 495k

Only top scored, non community-wiki answers of a minimum length are eligible