function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
infoaccount1infoaccount1 

Error message on page: System.QueryException: unexpected token: '@'

Hello! I need help. I wrote in Apex the following code and it gives me no error:

 

public pageReference doSearch2(){
if(searchtext != '' ){

list<list<sobject>> result = [Find :searchtext IN ALL FIELDS RETURNING accountr__c(id,Name, phone__c,Pertenece_a_GIE__c,creado_por__c,nombre_de_creado_por__c, accountnumber__c,ram__c, fax__c, website__c, type__c, numberofemployees__c , industry__c, annualrevenue__c, Description__c, Ejecutivo_Local_Colombia__c,
Ejecutivo_Local_costa_rica__c,Ejecutivo_Local_el_salvador__c,Ejecutivo_Local_estados_unidos__c,Ejecutivo_Local_guatemala__c,Ejecutivo_Local_honduras__c,Ejecutivo_Local_mexico__c,Ejecutivo_Local_nicaragua__c,Ejecutivo_Local_panama__c,Ejecutivo_Local_venezuela__c,Ejecutivo_Local_republica_dominicana__c
where creado_por__c in (select Ejecutivo_DP__c from usuarios_jn__c  where ejecutivo__c=:apexpages.currentpage().getparameters().get('id') )order by name )];
veraccount =((list<accountr__c>)result[0]);
}
return null;}

And when I actually test it in my page i receive the following message:
System.QueryException: unexpected token: '@'

 

Can somebody help me figure this one out? I couldn't find anything like this error on the discussion boards or anywhere else. I don't have anything resembling like an email to receive this type of message.

Please help me, it will be greatly appreciated

Dirk GronertDirk Gronert

AFAIK within the test run you do not have the apexpages.currentpage().getparameters().get('id') available!

 

Instead of using this I would recommend referencing an object in your controller and get the id ...

 

 

 

 

infoaccount1infoaccount1

Hello thank  you for answering but what I really need to obtain are the Ids of the object that is being referenced from not just one Id. Do you have another idea regarding this issue that can help me?

 

"where creado_por__c in (select Ejecutivo_DP__c from usuarios_jn__c  where ejecutivo__c=:apexpages.currentpage().getparameter

s().get('id') )order by name )];"

 

Without that sentence the code works just fine. Thank you.

Dirk GronertDirk Gronert
If you can share your apex and vf with me here or privately I can have look at it and can provide you a solution!

--dirk