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

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

I'm trying to set up a helper method to generate a ConnectApi.PollCapabilityInput class.  (This is part of a larger helper class to generate FeedItemInputs.)  According to the documentation, this class has two properties:
  • choices:  List<String> 
    • The choices used to create a new poll. You must specify 2–10 poll choices for each poll. 
    • Required for creating a poll.
  • myChoiceId:  String 
    • ID of an existing choice on the feed poll.  Used to vote on an existing poll. 
    • Required for voting on a poll.
Using the first one to add a poll seems fairly straight-forward, but I'm having trouble with how to use the myChoiceId to vote on a poll.  Specifically, once I create a PollCapabilityInput object with that field set, how do I use it?  Do I just add it to a blank FeedItemInput and post it?  What feed to I post it to, and what kind of FeedElement is it?

I would really like to see a complete example for this Capability, but I can't seem to find one, here or anywhere else.  Can someone point me toward such an animal?  If not, does anyone at least know how to use this class to vote on an existing poll?

Thanks,
Doug
 
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.
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?
  • November 20, 2015
  • Like
  • 0
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?