+ Start a Discussion
nithyanithya 

Viable alternative error

When I tried to add a flex component in VF page and tried to execute, i got the following error

no viable alternative at character '"' can any one help me to find out what is the cause?

 

Thanks

Nithya

Message Edited by nithya on 01-24-2010 11:18 PM
CaptainObviousCaptainObvious
Try using single quotes ' instead of double " quotes
nithyanithya

tried but not working. below is my code

<apex:page showHeader="false" standardStylesheets="false" >
<html lang="en"> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>DMEScript</title>
<style> body,html { height:100%;margin: 0px; overflow:hidden } </style>

 

<script src="{!$Resource.Flex_ac_oe_dme}" language="javascript" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript">
   var requiredMajorVersion = 9; var requiredMinorVersion = 0; var requiredRevision = 0;
</script> </head>

<body scroll="no"> <div height="100%" width="100%">
<script language="JavaScript" type="text/javascript">
var hasProductInstall = DetectFlashVer(6, 0, 65);
var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
if (hasRequestedVersion) {
var flashVars = '';
flashVars += "session_id={!$Api.Session_ID}";
flashVars += "&server_url={!$Api.Partner_Server_URL_150}";
AC_FL_RunContent( "src", "{!$Resource.DME2}", "width", "100%", "height", "100%", "align", "middle", "id", "DME2", "quality", "high", "bgcolor", "#ffffff", "name", "DME2", "allowScriptAccess","sameDomain", "type", "application/x-shockwave-flash", "FlashVars",flashVars, "pluginspage", "/go/getflashplayer" ); } </script> </div>

<noscript> Javascript reqired. Please turn on javascript. </noscript> </body> </html>
</apex:page>

pupilstuffpupilstuff

Hello Nithiya ,

 

I am also getting the same error .Please let m know how to resolve it

 

Thanks

 

thunksalotthunksalot

I'm having the same problem, but with a SOQL query in an APEX class:

 

global final String gstrQuery = "SELECT ID, StageName, Designated_Contact_Count__C from Opportunity where StageName != 'Expired'";
    global Database.QueryLocator start(Database.BatchableContext BC){
     return Database.getQueryLocator(gstrQuery);

Failure is at the first " in the first line.  I think I have to have the quotes because I want to do a string comparison in the WHERE clause. 

 

Any help much appreciated.

thunksalotthunksalot

Figured it out.  I'm just tired, so when I tried escaping the single quotes I used a forward slash instead of a back slash.  Escaping the single quotes worked in my case:

 

  global final String gstrQuery = 'SELECT ID, StageName, Designated_Contact_Count__C from Opportunity where StageName != \'Expired\'';