Skip to main content
3 votes

How to merge objects in query?

You'd need to create a wrapper class that has two instance variables (one for each of your 2 SObjects) so that you can make a single List<MyWrapperClass>. It'd need to have at least 2 ...
Derek F's user avatar
  • 62.7k
3 votes

DML on Sobject List

It depends on the circumstances, but the answer in general is "yes". When possible, you should do this, because a DML statement counts as one DML statement for the Governor Limits, even if ...
sfdcfox's user avatar
  • 497k
2 votes

List sorting by custom field

In 2024 things have improved. Salesforce introduced the Comparator interface, something that Java had at least since version 1.2. No need for wrappers or another query. In order to sort according to a ...
Felix van Hove's user avatar
1 vote

How can i change default list view for custom object

In the normal Classic mode, you can't override or default this page to go into your default view. You can either create a new Classic Console, or switch to Lightning Experience.
sfdcfox's user avatar
  • 497k
1 vote
Accepted

Compare 2 Lists of same sobject and store the unique records in a list

If the only difference is really that the records in the existing list have an Id, then the solution here is really simple. Iterate over the existing records Use .clone() (the first argument ...
Derek F's user avatar
  • 62.7k
1 vote
Accepted

SOQL inside invocable method returns no results

The invocable method is Apex and exists in a class that can be with or without sharing. If it is the former, then the SOQL query will only return data to which the contextual user has sharing access. ...
Phil W's user avatar
  • 37k
1 vote
Accepted

apex list of object

You can use a map to store the sum of the January_Volume__c and April_Volume__c fields for each year. You can use the Year__c field as the key and the sum as the value. You can then access the map by ...
Tushar Jadav's user avatar
  • 2,203
1 vote

Not able to add list<String> BCC to setBccAddresses ,VARIABLE_ASSIGNMENT [885 line] common.apex.runtime.impl.ScalarList@3fc50cb5

The code you have on the server is not the code you have in VS Code; the line of code that reads if(results[i].Success) { should be if(results[i].isSuccess()) {, so the code fails to compile and ...
sfdcfox's user avatar
  • 497k

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