Quantcast
Channel: How to initialize List/Set values by construction in apex? - Salesforce Stack Exchange
Browsing all 3 articles
Browse latest View live

Answer by IllusiveBrian for How to initialize List/Set values by construction...

Yes, you can do this as a single statement (which is what I assume you mean by line), however I would not recommend using this in actual code: Map<String, List<Configuration__c>> mapConfig...

View Article



Answer by Keith C for How to initialize List/Set values by construction in apex?

The problem is that the Apex list add method returns void a Boolean rather than the list itself. So it isn't possible to append to the list and initialize in one line. You can save one line of code...

View Article

How to initialize List/Set values by construction in apex?

I have different object snippet at many places (shown below) and I want below 4 lines to be converted into a single line. How we can do it in Apex ? Map<String, List<Configuration__c>>...

View Article
Browsing all 3 articles
Browse latest View live




Latest Images