You need to sign in to do that
Don't have an account?
Nagarjuna Reddy.P
System.QueryException : unexpected token
Hello Everyone,
Here is my simple soql query
public static List<Account> updateMethod(id Id,List<String> selectedFields) {
String squery = 'select Name,' +selectedFields+ 'FROM Account where id =:Id';
Account currentRec = database.query(squery);
}
Here selectedFields conatins accountfield API names which are passing from LWC js controller, I'm getting unexpected token issue
For Ex: selectedFields conatins Email__c,phone,name ect, I'm getting System.QueryException : unexpected token Email__c.
I'm not sure what might be the issue. Can any one help me.
Thank you.
Here is my simple soql query
public static List<Account> updateMethod(id Id,List<String> selectedFields) {
String squery = 'select Name,' +selectedFields+ 'FROM Account where id =:Id';
Account currentRec = database.query(squery);
}
Here selectedFields conatins accountfield API names which are passing from LWC js controller, I'm getting unexpected token issue
For Ex: selectedFields conatins Email__c,phone,name ect, I'm getting System.QueryException : unexpected token Email__c.
I'm not sure what might be the issue. Can any one help me.
Thank you.
Try Below Code Please Mark it As Best Answer If It Helps
Thank You!
Thanks for your reply, Actually return statement exists , I tried again but still no luck facing the same issue.
Paste The Below Line In place of String Query Please Mark It As Best Answer If It Helps
Thank You!