The tag has no wiki summary.

learn more… | top users | synonyms

5
votes
1answer
72 views

Custom Settings are NO SObjects - How to use them polymorphic?

My app uses different types of custom settings. Let's call them SettingA__c and SettingC_c. I want a method that handles both types of settings polymorphically. private void handle(SObject setting) ...
5
votes
1answer
77 views

Polymorphic ID does not accept external ID, or does it?

Requirement: Via APEX dataloader upload attachments (standard object) and link it via ParentId to a custom object's record. This works easily when the SFDC ID is provided for the polymorphic ParentId ...
2
votes
1answer
127 views

Polymorphic Lookups - How to pull the

I have a query in my class where I'm trying to pull in the position name from a task that is being created on an application. So I have Position, Application, and Candidate. The task is created on ...
5
votes
4answers
213 views

Typecasting for VisualForce?

I am not sure how to word the question; I apologize if the title is not relevant to my problem. Please pretend the following three classes are inner classes in a controller. I have a base class with ...
5
votes
1answer
291 views

Determine if a Type implements an interface

I've created an interface within a managed package that installers can implement (much like the example here and Making your managed package extensible with Apex Plugins). Clients can then configure ...
5
votes
1answer
253 views

Can I create a polymorphic key from a custom object?

I'm creating a custom object that needs to be related to multiple other objects (but only one per record). I.e. via a ParentId field it could be related to a Opportunity, a Contact, an Account, or ...
1
vote
2answers
220 views

Is the OwnerId field in the Report object a polymorphic key or not?

Is the OwnerId field in the Report object a polymorphic key or not? So the OwnerId field in the Report object can be either a reference to a Folder, Account, or User, doesn't this make it a ...
4
votes
1answer
576 views

Is SOQL Polymorphism enabled by default in API 26?

Is SOQL Polymorphism enabled by default in API 26? I'm getting the error 'SOQL TYPEOF expressions are not supported in this organization' error when deploying to my test org that's on API 26.
2
votes
2answers
454 views

SOQL Polymorphism Results

What kind of result set is returned from this SOQL and can I write this inside a for loop? [SELECT Name, Description, TYPEOF OwnerId WHEN Folder THEN Name END FROM Report]
7
votes
1answer
884 views

SOQL query on fields related by polymorphic lookups

Here is the SOQL query I am trying to make: List<Task> tasks = [ SELECT Id,ActivityDate,Status,Subject FROM Task WHERE What.Type = 'nexus__Goal__c' AND ...
8
votes
1answer
1k views

What are the best practices for using polymorphism in Apex?

Apex provides at least two different methods for polymorphism (that is, writing code that can use objects of different classes in a uniform way): Standard inheritance-based polymorphism, where code ...