Sebastian Kessel
  • Member for 6 years, 2 months
  • Last seen this week
Use Name vs DeveloperName for RecordType?
Accepted answer
19 votes

Actually, that is not quite true. Name is the field that the user sees when they choose it in the screen (or on the Page Layout). Developer Name is the API name for the record. This is very similar ...

View answer
LWC and complex parameters
Accepted answer
15 votes

After 2 hours of struggling, and only 5 minutes after posting, here is the answer: You have to add add {get;set;} explicitly for this to work. Changing my inner class to the below fixed the problem. ...

View answer
Lightning Component - Close Case Button not working
Accepted answer
15 votes

You have a common problem. Your lightning method and your apex method have the same name. Change one of them to something else (closeCaseApex, for example) and this should work). Since you have no ...

View answer
Why do primitive variables behave differently than object variables when being passed through void methods?
Accepted answer
13 votes

This is because objects and primitives behave differently in apex. “In Apex, all primitive data type arguments, such as Integer or String, are passed into methods by value. This means that any ...

View answer
Lightning multiple enqueued actions execute action when all are done
Accepted answer
12 votes

Eric, I like to use Promises for that. This is my preferred pattern First Define each promise (I do this in the helper) myPromise1 : function (component) { var action = component.get('c....

View answer
Lightning Design System with Visual Force Page
Accepted answer
11 votes

The answer to your first question is "YES". The second answer, however, varies. If you plan to use <apex:inputText>, <apex:pageBlock> and other things like that, then the Trailhead (and I)...

View answer
Unable to pass parameters to wired property in LWC
Accepted answer
10 votes

Per the documentation here you want to mark your @wire methods differently. Also from the doc: In the wire adapter’s configuration object, prefix a value with $ to reference a property of the ...

View answer
Account that has related contacts should not be deleted
Accepted answer
10 votes

Your trigger is a Before Insert/Update. Try: trigger DoNotDeleteAccountHavingRelatedContact on Account (before delete) And do replace Trigger.new with Trigger.old ** UPDATE ** Another commenter ...

View answer
How can I avoid too many SOQL queries on MASSIVE test classes?
Accepted answer
10 votes

I know you said you wanted to avoid breaking the test classes up, but that's exactly what I suggest. Hear me out. One of the things you can do (and I suggest you do) is simply bypass those trigger ...

View answer
Is Salesforce DX compatible with Classic?
Accepted answer
9 votes

Salesforce DX is a new approach to development, not a new interface. As such, it will support all the features that the org supports. This means that you will be able to write Apex, Lightning and VF ...

View answer
How can I get my correct current local time?
9 votes

This code will get you the local time for the logged in user, by leveraging the timezone offset to subtract/add from GMT. It's even smart enough to account for Daylight Saving. TimeZone tz = UserInfo....

View answer
Big Object not deploying to Salesforce
Accepted answer
8 votes

When you deploy "Check Only", you are just validating, not actually committing your changes. Remove that selection (i.e. Select only Single Package) and you will be good to go. Note: As stubborn for ...

View answer
String Concatenate +=
8 votes

+= is an operand that basically mimics x = x +. In this case, query += "aa" means query = query + a. In effect, you are adding the new value to the original. This works as well for numbers. For ...

View answer
How to opt out of FLS validation when a SOQL query is run by a trigger?
Accepted answer
7 votes

I am partial to stripInaccessible because WITH SECURITY ENFORCED because the queries throw an exception if any of the fields are not available to the user. I would not make it automatic to trigger ...

View answer
How to pass value to another component in lightning?
7 votes

Your aura:handler tag has action="act", when it should be action="{!c.act}". Don't forget that it has to point to a controller action. Also, on your declaration, you're using a period instead of a ...

View answer
Getting Error: Unknown property 'ContactStandardController.conList'
7 votes

You are missing the extension in your VF page. Your first line should be <apex:page standardController="Contact" extensions="ContactEditController" /> However, unless you make a quick change ...

View answer
Multiline if Statements
7 votes

Yes! The example below works just fine string a; string b; string c; if (a == b || b == c) { //Do something }

View answer
How to perform Soql query outside for loop?
Accepted answer
7 votes

Here is one approach. First get a set of the products you're going to need Get all the PBEntry records at once and put them on a map (key = the product name) so you can retrieve them easily later In ...

View answer
Cannot convert Boolean to String
7 votes

How about Boolean theBool = true; String theString = (theBool) ? 'true' : 'false'; It's more verbose but it works. PS: in the Debug Log you will not see strings in quotes, are you sure that the ...

View answer
Prevent users from directly creating cases of a certain record type
Accepted answer
7 votes

I would recommend that you make the Record Type unavailable to all profiles. That will prevent the users from creating records with (or changing them to) that Record Type. Once that is done, in your ...

View answer
How to SOQL query contacts by phone number when there are more than 100,000 contacts
Accepted answer
7 votes

You can try two things, 1) You can ask SFDC to index those fields, that would help. 2) Use SoSL. This may not apply to you but it may be worth a shot Your query would be: List<List<SObject&...

View answer
How to write SQL query to pull only not matching Email IDs
6 votes

One way to do this is to leverage LEFT JOINS and subqueries SELECT Id, Name, EmailId FROM (SELECT TABLE2.Id AS 'Id', TABLE2.Name AS 'Name', TABLE2.EmailId AS 'EmailId', TABLE1.Id AS 'SecondId' ...

View answer
Get number of milliseconds since January 1, 1970, 00:00:00 UTC in apex
6 votes

Per this document, you can use get the getTime() method for this. getTime() Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this DateTime object. In your ...

View answer
How to test CRUD and FLS in unit tests?
Accepted answer
6 votes

There are a few different ways to attack this problem, but the most common is to create a user with permissions, and then use System.runAs to execute your tests. I normally grant permissions to my ...

View answer
Unexpected character ('}' during JSON desearilization
Accepted answer
6 votes

Once you add the curly brackets, your JSON looks like this { [ { \"sampleNumber\":\"WO-02609\", \"SampleID\":\"a3F5C000000CHATTAM\", \"state\":\"Open\" } ] } Which is ...

View answer
Retrieve parent values from getPopulatedFieldsAsMap?
Accepted answer
6 votes

Contact__r looks like it's an object. You can get the object by doing this: Contact cnt = (Contact)fieldsPopulated.get('Contact__r'); system.debug('Email: ' + cnt.Email); system.debug('Name : ' + cnt....

View answer
Lightning init handler called multiple times
Accepted answer
6 votes

I marked it as a possible dupe of this question, but here is the answer. You cannot name the Apex Component method identically to the Lightning Controller method. Not sure why, but it creates ...

View answer
Lightning Component - pass variables from component to apex & get result back
Accepted answer
6 votes

You're encountering a little-known bug in Lightning that occurs when your JS function has the same name as your controller's Apex method name (in you case, format_date). The code goes into recursion ...

View answer
What are the advantage of the @testSetUp annotation
6 votes

From my humble point of view, the biggest advantage is to not have to duplicate code and have a consistent set of data that you can use for all the tests in a given class (or classes). However, there ...

View answer
Scheduling an apex batch
Accepted answer
6 votes

This code: SchedulableClass saturday1am = new SchedulableClass(); String sch = '0 0 01 ? * 7'; String jobId = system.schedule('sat1am', sch, saturday1am); Needs to be outside of that class, since ...

View answer
1
2 3 4 5
13