You need to sign in to do that
Don't have an account?

Malformed query: Unexpected Token Help
The following error occurrs but I don't know how to solve this.
A problem with the OnClick JavaScript for this button or link was encountered:
{faultcode:'sf:MALFORMED_QUERY', faultstring:'MALFORMED_QUERY:
from Enrollment__c where Id IN (a0Fe000001LIGIEA4)
^
ERROR at Row:1:Column:78
unexpected token: 'a0Fe000001LIGIEA4'', detail:{MalformedQueryFault:{exceptionCode:'MALFORMED_QUERY', exceptionMessage:'
from Enrollment__c where Id IN (a0Fe000001LIGIEA4)
^
ERROR at Row:1:Column:78
unexpected token: 'a0Fe000001LIGIEA4'', row:'1', column:'78', }, }, }
The following is part of my code,
var PActivityQuery = "Select (Select Id From Program_Activities__r) From Enrollment__c WHERE Id = " + enrollObj.Id; var PAqueryResult = sforce.connection.query(PActivityQuery); var EnrollIt = new sforce.QueryResultIterator(PAqueryResult); while(EnrollIt.hasNext()) { var tempPAEnroll = EnrollIt.next(); var newPActivity = []; if(tempPAEnroll.Program_Activities__r) { var PAit = new sforce.QueryResultIterator(tempPAEnroll.Program_Activities__r); while(PAit.hasNext()) { var PActivityObj = PAit.next();
Thanks
Hi,
As you are using a nested query & you have missed to specify the fields in the outer query, this exception is thrown. Replace
with
Hey, thanks for the reply. I tired what you said but it still giving me the same exception. Anyother idea!?
Thanks
Hi,
Forgot to notice the usa of double quotes for the String. are you using single quotes insted of double quotes?
Hey, thanks for the help again. But I don't think single quotes or dobule quotes matters. I tried both and both of them still didn't work and giving the same exception. Got any other idea?
Thanks
eg:
..........where Id IN ('a0Fe000001LIGIEA4')
Regards,
Satish Kumar