Questions tagged [abstract]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
6
votes
2answers
337 views

Cannot deserialize JSON as abstract type

When running a test that's deserializing a JSON string, I get the error message: Cannot deserialize JSON as abstract type: TestController.Item The JSON contains a list of objects which is abstract ...
0
votes
1answer
530 views

Critical update error now showing up

Recently, Salesforce came out with a critical update to Restrict Reflective Access to Non-Global Constructors in Packages. The update is active in my org. My code uses Type.newInstance. I'm a bit ...
13
votes
2answers
2k views

Can create an Instance of Abstract Class, Salesforce Bug?

I was playing with Apex and stumbled upon this. Created an Abstract Class and made the constructor as private, so that noone can create an instance of it. This works just fine during compilation. it ...
7
votes
1answer
152 views

Is it possible to invoke “super” with less ambiguous results?

I have an abstract parent class with some dependency and a default implementation. The constructors might look like: public abstract class ParentClass { protected SomeDependency someDependency; ...
-1
votes
1answer
197 views

How does object inheritance interact with sharing inheritance?

Let's say I have some class: public abstract without sharing MyUnsharingClass { // Some methods... } which is extended by public SomeClass extends MyUnsharingClass { // Some methods... } ...
9
votes
2answers
819 views

How to use @AuraEnabled base class method in Lightning Component?

We are consolidating our common methods into an Abstract controller base class. Here's an example: public abstract class CommunityControllerBase { /* Returns a select option list of ...
1
vote
0answers
27 views

State transfer between abstract extensible component and lightning:isUrlAddressable

I've got a little problem and thinking I might have designed my component a little incorrectly. I'm storing quite a bit of state in an abstract extensible component for convenience. I've noticed if I ...
4
votes
2answers
343 views

How can I upsert a homogeneous List<SObject>, in a good way? [duplicate]

I have some abstracted code, which at the end of some process will create a homogeneous list of SObjects. It could be a list of Accounts, it could be a list of contacts, it could be a list of some ...
0
votes
0answers
210 views

Utility methods failing with 'cannot call test methods in non-test context'

I generate a number of different email notifications from Cases, with variations depending on Account location, for example. They've morphed from basic workflow email templates in order to gather ...
5
votes
0answers
223 views

Using abstract component to iterate sub-component - how to correctly bind state?

I have this idea for a generic component that would allow adding, deleting and copying entries in the form - abstract component handles adding, cloning, etc, while your main component holds actual ...
1
vote
1answer
518 views

Abstract Class with Generic Type?

Is there a way I can implement something like an abstract class with a generic type? For example, I want to be able to write code like the following (I know there are issues there). The main error I ...