​ConnectApi.PollCapabilityInput pollInput = new ConnectApi.​PollCapabilityInput();

The above code does not compile. The error says:

Error: Compile Error: Invalid type: ConnectApi.​PollCapabilityInput

Other ConnectApi uses are fine. The class is at API version 34.0. Any one has the same issue?

  • 1
    What is your API version of the class? Check in the .xml – Boris Bachovski Jul 1 '15 at 4:07
  • API version is 34.0 – user4402671 Jul 1 '15 at 4:16
  • How are you saving the file Eclipse, MavensMate or directly in Browser? – Vikas Khandelwal Jul 1 '15 at 5:40
  • Directly in Browser. – user4402671 Jul 1 '15 at 13:53

You're missing the namespace ConnectApi:

ConnectApi.PollCapabilityInput pollInput = new ConnectApi.PollCapabilityInput();

seems to be working for me.

Execute Anonymous via Developer Console (browser):

ConnectApi.PollCapabilityInput pollInput = new ConnectApi.PollCapabilityInput();
pollInput.choices = new List <String> {'Option 1'};


09:55:19:078 USER_DEBUG [3]|DEBUG|Option 1

| improve this answer | |
  • That was a typo. I have ConnectApi.PollCapabilityInput pollInput = new ConnectApi.PollCapabilityInput(); I couldn't save this in browser. Other calls are working. – user4402671 Jul 1 '15 at 13:52
  • can you please attach your example method here? – user4402671 Jul 1 '15 at 14:15
  • Updated my answer @user4402671 – Boris Bachovski Jul 1 '15 at 23:57
  • 1
    Thank you so much!! I copied them into developer console and there was a bad character. Now I got this to work. – user4402671 Jul 2 '15 at 0:44

I think you are missing connectApi. If not then this issue generally comes when we save apex class from eclipse or some other IDE, In your case you should have 34.0 version of force.com plugin ID.Try to save in Browser.It should work

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.