Questions tagged [interface]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
0answers
24 views

Class vs Interface in Patch org

Why am I able to change the access specifier for an interface in a patch org but I can't do the same for a class? I know the documentation mentions some restrictions for patch orgs. I'm assuming the ...
5
votes
2answers
163 views

An inner interface inside an outer interface is not supported in Apex?

Can't find a post saying this, and I get a compile error, but just to be sure, this is not supported in Apex right? public interface Access { public interface Context { ... } ...
2
votes
1answer
44 views

Do callable classes still need to be marked as global to access them outside of managed packages?

I created a callable class for a managed packaged but I am unable to actually get an instance while calling it from outside the package. In execute anonymous: Type.forName returns null Callable ...
0
votes
0answers
43 views

Exception is System.TypeException: Collection store exception putting Decimal into Map<String,String>

Below is the piece of code which throws the exception Exception is System.TypeException: Collection store exception putting Decimal into Map private void myMethod (String name, List<Object> ...
1
vote
1answer
36 views

Object Permissions from permissions sets don't work as expected

What does the " -- " in the type of permission object? I need to set this to readOnly
2
votes
1answer
35 views

Managed Package - Global interface and global/public class

Let's say we have global ProductFactory class like this: global class ProductFactory { global static ProductService getProductService() { return new ProductServiceBasic(); } } ...
1
vote
2answers
223 views

Variables in Interface in Salesforce

Can you declare variables in Interface in Apex (Salesforce). In Java, it allows you to declare and initialize variables with public static final keywords in Interface. Also in Apex, are all abstract ...
2
votes
1answer
137 views

Where or how can I find what interfaces an out of the box Apex class implements?

Is there a method of discovering (or a place to look up) all of the interfaces that an out of the box Salesforce class (Like LoginHistory) implements? The reason I ask: I'm attempting to test a ...
1
vote
1answer
583 views

Lightning Component force:hasSObjectName, sObjectName undefined

Per the force:hasSObjectName interface documentation, I can reference an automatically added attribute named sObjectName to retrieve the object where my custom lightning component is being accessed. ...
13
votes
2answers
1k 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 ...
1
vote
2answers
435 views

Does Database.SaveResult, Database.DeleteResult, etc. implement a public interface?

The various DML operations (insert, update, delete, etc.) all return results with very similar methods and properties. It is not uncommon, as a developer, that I should want to handle these results ...
4
votes
2answers
461 views

Apex PMD: Avoid empty block statements

Perhaps this isn't the place for this -- but it looks like a good place to start. I'm using Apex PMD code analysis (within Visual Studio Code) and it's throwing off the following for an interface ...
0
votes
1answer
59 views

Global Inner Interfaces in managed package

We have an global interface inside a global class: global class SomeClass { global interface someInterface() { //various methods returning and accepting standard Apex objects only String ...
1
vote
2answers
144 views

Design pattern for an attachment trigger using trigger framework?

Hoping to tap into the wisdom of the Apex design pattern wizards out there. We have recently moved to a trigger framework in order to decouple and standardize our wildly disparate trigger code ...
4
votes
1answer
170 views

Versioning Apex Interfaces in managed packages

As documented in What are the pitfalls around Apex Interfaces in managed packages? a global Apex interface that has been published in a managed package can't be modified. Trying to do so results in ...
20
votes
2answers
542 views

Are Apex interfaces and abstract classes case-sensitive?

My understanding from the docs is that apex class and method names are case-insensitive. I've run across an edge-case with interfaces and abstract classes which appears to be undocumented behavior ...
4
votes
2answers
306 views

What are the risks or drawbacks of creating Parameterized Interfaces using of the Apex API version 25?

Unfortunately, as of API version 26, SFDC removed parameterized interfaces. However, it is relatively easy to create new interfaces and set the version as 25. So, to take the example from ...
0
votes
2answers
71 views

Is there a dictionary of SFDC native interfaces we can leverage in Apex code? [closed]

Interfaces are wonderful for creating reusable code, as well as enabling us to reuse or make better use of the functionality SFDC already provides us. The Apex Developer's Guide tells us how to ...
3
votes
1answer
1k views

Inner Classes/Interfaces

the guide says that one difference between Java and Apex is: Inner classes and interfaces can only be declared one level deep inside an outer class. Considering I know in Java what is an Inner class,...
2
votes
1answer
41 views

Can Interface declare only methods?

I have created the following interface and a class that implements it. global interface SampleInterface { String logicA(); } public class SampleClass implements SampleInterface { public ...
0
votes
0answers
76 views

Invoking AWS CLI from Apex class

I need to invoke AWS Command Line Interface from a apex class. Can someone please help me in that? Thanks.
2
votes
0answers
362 views

Global Interface in managed package

We are building a managed package and we have an understanding gap on the usage of Global Interface in the code. Couple of months back our package was rejected in the security review citing usage of ...
2
votes
0answers
121 views

Impossible to add “flexipage:availableForRecordHome” on a component

I'm trying to create a new lightning component that should be displayed on a record page. However the error I'm getting this error when I'm adding the interface Deployment Failed: ...
11
votes
1answer
991 views

How to deserialize into interface type when concrete type is unknown

As a follow up to this question: I am essentially trying to deserialize a JSON object into an Interface Type. Unfortunately we cannot deserialize using an Interface as the ApexType and must know ...
4
votes
2answers
558 views

Cannot deserialize JSON as abstract type?

While writing a class to help me manage @future jobs for a project, I stumbled onto an error message I can find very little help on. Cannot deserialize JSON as abstract type I used an interface ...
7
votes
1answer
1k views

Static method able to be called/executed from class instantiated from type.newInstance() with interface. Expected?

When trying to execute a static method from an instance of a class testMe tmp = New testMe(); tmp.myStaticMethod('a','b'); we get the familiar: Static method cannot be referenced from a non ...
11
votes
1answer
2k views

Are Lightning Interfaces (e.g. implements=“c:MyInterface”) actually useful for anything?

I've been trying to build a Lightning Community where I use component inheritance and interfaces to share certain bits of functionality. For my particular use, composition wouldn't fit as well as ...
4
votes
1answer
3k views

How Custom Iterators with Iterable Work

I was reading the topic of using iterator and iterabel Interface - https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_iterable.htm It says : If you do not want ...
2
votes
1answer
211 views

Programmatically list all public/global attributes on a lightning component

Salesforce has provided some new lightning component interfaces to make communities a bit more customizable. They have provided some documentation for these, but it is weak at best: https://...
0
votes
1answer
451 views

Using interfaces as parameter arguments

Is it possible to use interfaces as parameters within Apex? As an example: public interface InterfaceExample{ void example(InterfaceExample ex); // Will not compile InterfaceExample example2(...
6
votes
1answer
236 views

Doesn't Set<T> collection implement Iterable<T> interface? [duplicate]

I am trying to join String elements of Set with semicolon. Set<String> elements = new Set<String>{ 'foo', 'bar' }; System.debug(String.join(elements, ';')); getting the ...
1
vote
1answer
146 views

Clearing (or Cleaning) Global Search Cache - False Results - Sharing

How do we get Global Search to NOT show results that are NO LONGER VISIBLE to the logged in user? More quickly? Ever? I'm noticing as we test our implementation in Sandbox that when I login as ...
1
vote
0answers
40 views

Error: Managed interface that is released can't implement new interfaces (bug?)

I have a managed package with the following class already in it: global class MyInterfaceClass { global interface InnerInterface {} global interface DeepInterface extends InnerInterface {} } ...
1
vote
1answer
4k views

custom component not showing up in community builder

a custom lightning component I just created is not showing up in my community-community builder custom component list as an option to use. I have had this issue before but forget how to make it ...
0
votes
1answer
21 views

Designed schema and loaded data — is it possible to build an app that will just visualize this data from custom user requests?

Quick question -- I'm new to salesforce but I tried to dig around and want to 1) check if my understanding is correct and 2) see if something is possible. Basically, I have a schema that I built ...
-1
votes
1answer
169 views

what is interface method in salesforce ? How Many types Of Interfaces Is ther In salesforce [duplicate]

what is interface? when using interface? In Salesforce Give Me Explination
2
votes
1answer
176 views

Using interfaces from managed package

We have a managed package. In the managed package, we have a button in the application. When the user clicks on the button, we want the customer's specific logic to be executed (which could ...
2
votes
1answer
69 views

Enable collapsible sections for partner users

I have "Enable Collapsible Sections" checked in the User Interface settings. However it currently only works for Users, not Partner Users. Is there a way to enable this for Partner Users too?
20
votes
4answers
7k views

Why use an interface in Apex?

I'm studying for my Platform Dev I exam, and I've been reading about interfaces. I understand how they work in abstraction, but what I don't understand is why you would use them. The documentation ...
5
votes
2answers
833 views

How to Create a Custom App Settings Page?

I would like to create a custom app package that provides the user with a setup interface in which they can input their own preferences, which inputs will then be referenced by apex code. I will be ...
19
votes
1answer
1k views

Abstract, Interface, Classes OH MY - Question on Approach

So I believe that I have a real world use case for an object model that uses abstract classes and interface. I do however have a few questions about the best way to go about it: Interface public ...
0
votes
1answer
266 views

extend a class that implement Messaging.InboundEmailHandler (email service)

I use to develop in java where i can extend a class that implement an interface. This way, the child-class implement the interface too and extends the overrided methods. I am trying to do the same ...
3
votes
3answers
381 views

How do you bring up the window showing Tasks?

There's a window that shows Tasks -- it may be called the "reminder window". It usually shows up when I log in, but somehow it got closed. How do you bring this window up? The Window I'll describe ...
4
votes
1answer
280 views

What are the pitfalls around Apex Interfaces in managed packages

I would like to add an interface to one of our managed packages. This interfaces would be implemented by custom code in a customer org where the package is installed. It would be called from a custom ...
4
votes
2answers
865 views

Can interface have inner classes or interfaces?

Can interface have inner classes or interfaces? Looks like it is not possible and the answer is no, however it is not mentioned anywhere in the documentation https://developer.salesforce.com/docs/...
3
votes
1answer
3k views

Must a class implementing a global interface also be global?

As stated in the title, when I implement a global interface, do I need to make the implementing class global, for example when implementing Schedulable or Database.Batchable<SObject>? global ...
2
votes
2answers
106 views

Base Class or Interface for Custom Settings

Is exist Interface or Base class for Custom setting? I tried use SObject class, but it does not support Custom Settings Methods. For any SObject we can use SObject class, that base class for standard ...
1
vote
2answers
78 views

ISV-internal interface between Base and Extension Package - Best Practises?

We are an ISV with multiple managed packages that build on each other. EXTENSION builds on data in BASE. We now want to start to add Apex code in EXTENSION that uses and enhances code in BASE. How ...
5
votes
2answers
1k views

One Class to control all Trigger. - Dispatcher

I'm having some problems when trying to make a number of classes and triggers to run on a dispatcher class. The components for this architecture are the following: One -TriggerDispatcher class. ...
6
votes
1answer
774 views

One Trigger to rule all!

I'm trying to make work a trigger architecture pattern that was designed by Adam Purkiss, I believe around 2012. I know that there are other more recent designs but I just want to try this one from ...