Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Questions relating to Apex, the native programming language for the Force.com platform. Use it for general questions on syntax, errors, constructs, and rules of use. Most questions should include a code *excerpt* to help answerers understand specifically what has gone wrong or why you need help.
3
votes
Get One Item From a Set
You can do:
Set<String> someSet = new Set<String> { 'first', 'second' };
if (!someSet.isEmpty()) {
String first = someSet.iterator().next();
System.debug(first);
}
But be aware that iterator …
0
votes
Static method able to be called/executed from class instantiated from type.newInstance() wit...
That is another weird behavior of Apex. The thing is, this should not be allowed at all. You should not be able to implement an interface using a static method, that simply doesn't make sense. … Even if you try to make that static method @Future and then call it from the instance as you did in the example, Apex will ignore it and execute that method synchronously. …
2
votes
Accepted
Test class code coverage for lookup field and URL field
In your case, during executing test class this query [SELECT id FROM Account WHERE Account_ID__c = : itemd.Seller_ID__c] returns nothing.
In order to cover these lines:
itemd.Account__c = results.get …
2
votes
0
answers
362
views
Not able to access interface methods from an abstract class instance
I'm trying to build an Apex classes structure where I have two (or more) entities that have something in common but at the same time have a different set of fields. …
0
votes
How can i test my Apex method
There is no way to dynamically edit picklist field values in Apex (you can use Metadata API but that is not worth it in your case). …