Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8080679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:29:22+00:00 2026-06-05T16:29:22+00:00

Hi i am getting the following error in this code /* Class : CreateMobileChatterCntrl

  • 0

Hi i am getting the following error in this code
/*
Class : CreateMobileChatterCntrl
Description : Post Chatter on Contact.
Developed by : Harish Khatri(Appirio Offshore)
Created Date : June 2, 2012
*/

public without sharing class CreateMobileChatterCntrl {
  public final Id ContactID{get;set;}
  public String message{get;set;}
  public boolean isSuccess{get;set;}
  public boolean throwError{get;set;}
  public String deviceType{get;set;}
  //----------------------------------------------------------------------------    
    //constructor
  //----------------------------------------------------------------------------  
  public CreateMobileChatterCntrl() {
    throwError = false;
    isSuccess = false;
    if( ApexPages.CurrentPage().getParameters().get('id') != null){
      ContactID = ApexPages.CurrentPage().getParameters().get('id');
    }
    String userAgent = ApexPages.currentPage().getHeaders().get('USER-AGENT');
    if(userAgent.contains('iPhone')) 
      deviceType = 'iPhone';
    //else if(userAgent.contains('Android')) deviceType = 'Android';  
  }
  //----------------------------------------------------------------------------    
    // Post the chatter on contact
  //----------------------------------------------------------------------------
  public Pagereference save() {

    if(message == null || message ==''){
      throwError = true;
      return null;
    }

    FeedItem feedItem = new FeedItem();
    feedItem.ParentId = ContactID;
    feedItem.Body = message;

    try {

      insert feedItem;
      isSuccess = true;

    } catch(Exception e){}
   return null;//new PageReference('/' + ContactID);
  }

  public Pagereference cancel() {
    return new PageReference('/' + ContactID);
  }
}

public final Id ContactID{get;set;} at this line i am getting the error No Viable Alternative at character ‘ ‘.can any one please help why i am getting this error??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T16:29:23+00:00Added an answer on June 5, 2026 at 4:29 pm

    Some of the single quote characters in your class file are invalid — perhaps because you copied and pasted the code from somewhere else. I’ve had this happen many times before when I’ve copied code from elsewhere. Starting with the quotes in: message == ” , i’d delete the single quotes, retype them, and resave your file. Repeat for all single quotes (or do a find and replace).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting this error when I run the following code: #!/usr/bin/env ruby -rubygems
I was getting the following error when runing such this code: var dbContext =
I'm running Valgrind and I'm getting the following error (this is not the only
We are getting following error when we try to validate our app. This bundle
After resolving issues with RIA installation here , I'm still getting this following error.
I am getting the following error in my code: System.JSONException null Don't know the
I'm getting the following error message: NHibernate.HibernateException: NHibernate.HibernateException: Unable to resolve property: Id. This
I am getting the following error from my code: Attempt to split long or
I am getting the following error: The constructor Intent(new View.OnClickListener(){}, Class<DrinksTwitter>) is undefined In
I am getting the following error message. Any ideas how to resolve this? Compilation

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.