The tag has no usage guidance.

learn more… | top users | synonyms

10
votes
1answer
280 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 ...
3
votes
1answer
39 views

apex String instanceof Object?

given: Map<String, String> m = new Map<String, String>(); m instanceof Map<String, Object> is always true then why is m instanceof Map<Object, Object> always false?
2
votes
1answer
41 views

Owner PhotoUrl VisualForce

Is it possible to display the FullPhotoUrl or SmallPhotoUrl of a User owner with Visualforce only? I know how I would implement with an extension but I would like to avoid writing one if possible. ...
4
votes
1answer
75 views

Abstract Class Constructor: Possible to Inherit? [duplicate]

I have tried the following: public class OuterClass { abstract class abstract AbstractInnerClass { final Object member; public Abstract InnerClass(Object member) { this.member ...
1
vote
1answer
30 views

Compare Contract End Date to ActivityDate on Task of Child Custom Object

I'm going round in circles trying to figure out how to approach this one - I have a Contract with an end date The Contract has a child object (Contract Work) Contract Work has tasks I want to ...
2
votes
2answers
114 views

Developer Console throws Type Exception

I have a base class that's a mash up of the base classes here. What's important is that this class contains the following property and method: public CommunicationBase Owner { get; set; } public ...
4
votes
1answer
264 views

Is SOQL Polymorphism also supported in WHERE clause?

I am using the polymorphism in my SOQL queries which is working fine, an generic example of the query is below SELECT TYPEOF What WHEN Account THEN Phone, NumberOfEmployees ...
23
votes
1answer
432 views

When is SOQL Polymorphism going to be enabled by default?

SOQL Polymorphism (SELECT TYPEOF) was introduced in Winter 13, API version 26 for developer organization. Is this feature going to be enabled by default for production organizations also sometime in ...
1
vote
2answers
2k views

Determine Case owner is queue or user?

how to check whether a case owner is a queue or a user? I am writing a validation rule where i need to check who is the owner of the case.
3
votes
2answers
405 views

Custom object parent relationship similar to “Attachment” object

Can we have a custom object similar to Attachment object where the parent can be any of the "Account", "Contact", "Lead" etc? ...
5
votes
3answers
195 views

How can I get a polymorphic relationship to update a user lookup field?

Why isn't this code writing the lead owner's manager to the Lead_Owner_Manager__c field? if(Trigger.isUpdate && System.Trigger.oldMap.get(x.Id).OwnerId != x.OwnerId){ dh.Old_Value__c ...
5
votes
1answer
343 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
242 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
394 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 ...
7
votes
4answers
698 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 ...
7
votes
1answer
758 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 ...
9
votes
1answer
849 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
565 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 ...
5
votes
1answer
1k 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
806 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]
8
votes
1answer
2k 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 ...
11
votes
1answer
4k 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 ...