• Douglas Hauck
  • NEWBIE
  • 10 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 5
    Replies
Hey, all -

I am creating an Apex helper class to generate Chatter FeedElements, and I would like to allow the calling method to specify whether the element allows Likes.  According to the documentation, this is determined by whether the element Capabilities include the ChatterLikesCapability class. 

Fair enough, except that the actual FeedElementCapabilitiesInput does not contain a property for ChatterLikes, nor is there a subclass of the FeedElementCapabilitiesInput Class for ChatterLikes.  There are other capabilities that are in the Output class but not the Input class, as well.  How are these set, if not through the Input class?

Thanks,
Doug
I am creating a helper class with several static methods to assist with various common tasks.  One of the methods takes a parameter that can have one of about 130 preset string values.  To make it easier for future developers, I created an Enum with an item for each of the preset values.

Unfortunately, I am getting an error message from the Developer Console: "Maximum number of enum items exceeded: 100".  That limit will create a real problem for me, and it also seems kind of arbitrary (as opposed to, say, 255 or 65535).  I was hoping to find somewhere that I could maybe bump that up, but I can't find any mention of it at all, in any of the documentation.

Does anyone know where this comes from, why there is this seemingly arbitrary limit, and whether it can be adjusted?  If not, has anyone run into this before who could maybe help me out with a workaround?  Yes, I know I could make a Map, but Maps don't work the same (especially as regards the nice auto-fill functionality that comes from an Enum class.
I created a User Trace Flag for one of my Apex Class with all the specified data such as (​Name    LogType    Requested By    Start Date    Expiration Date    Debug Level Name), but unable to see it under the ​User Trace Flags.

Am I missing anything while creating the Trace Flag?
I'm trying to extend the System.Exception class to add some logging and email functionality.  My interest is in having a constructor like this:

class APException extends Exception {
  public APException(String message) {
    super(message);
    logException();
    mailNotify();
  }
}

This code gives me a compile-time error: System exception constructor already defined: <Constructor>(String, Exception).  

I've even tried adding a dummy argument so that the method signature doesn't match any existing Exception constructor.  That only leads to another error: Object has no superclass for super invocation.

What is the right way to do this?  Or can it not be done?