• Nick Stebner
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
Hello, and thanks in advance for any responses!

I am trying to return a list of records from another custom object (Values_dreams_Goals) for display on my current custom object (VDG_Display).  The code below has been adapted from another application in the same org that works just fine, but returns the query error below.

System.QueryException: unexpected token: SELECTValues_Dreams_Goals__c 
Class.GoalListExt.getGoalItems: line 25, column 1

My offending class is below.  Line 25 is marked, but I may have an error in the query language itself, since I'm somewhat unfamiliar with it.

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
public class GoalListExt {

    
    public id householdId {get;set;}
    public VDG_Display__c thisDisplay {get;set;}
    
    public list<Values_Dreams_Goals__c> GoalItems;
    public integer QUERY_RECORD_LIMIT = 25;
    
    public GoalListExt() {
   
    }
    
    
    public list<Values_Dreams_Goals__c> getGoalItems()
    {
    
     string parentID = householdId;
     string query = 'SELECT';
     for(Schema.FieldSetMember f : this.getGoalItemsFields())
     {
         query += f.getFieldPath() + ',' ;
     }
     query += 'Id FROM Values_Dreams_Goals__c WHERE Household_linked__c =: parentID limit:QUERY_RECORD_LIMIT';
line 25 -->     GoalItems = (list<Values_Dreams_Goals__c>)  Database.query(query);
     return GoalItems;
     }
    
    public List<Schema.FieldSetMember> getGoalItemsFields() {
        return SObjectType.Values_Dreams_Goals__c.FieldSets.VDGTable.getFields();
    }
}
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Any help would be appreciated.
Thanks in advance.

Nick 
 
Hello, and thanks in advance for any responses!

I am trying to return a list of records from another custom object (Values_dreams_Goals) for display on my current custom object (VDG_Display).  The code below has been adapted from another application in the same org that works just fine, but returns the query error below.

System.QueryException: unexpected token: SELECTValues_Dreams_Goals__c 
Class.GoalListExt.getGoalItems: line 25, column 1

My offending class is below.  Line 25 is marked, but I may have an error in the query language itself, since I'm somewhat unfamiliar with it.

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
public class GoalListExt {

    
    public id householdId {get;set;}
    public VDG_Display__c thisDisplay {get;set;}
    
    public list<Values_Dreams_Goals__c> GoalItems;
    public integer QUERY_RECORD_LIMIT = 25;
    
    public GoalListExt() {
   
    }
    
    
    public list<Values_Dreams_Goals__c> getGoalItems()
    {
    
     string parentID = householdId;
     string query = 'SELECT';
     for(Schema.FieldSetMember f : this.getGoalItemsFields())
     {
         query += f.getFieldPath() + ',' ;
     }
     query += 'Id FROM Values_Dreams_Goals__c WHERE Household_linked__c =: parentID limit:QUERY_RECORD_LIMIT';
line 25 -->     GoalItems = (list<Values_Dreams_Goals__c>)  Database.query(query);
     return GoalItems;
     }
    
    public List<Schema.FieldSetMember> getGoalItemsFields() {
        return SObjectType.Values_Dreams_Goals__c.FieldSets.VDGTable.getFields();
    }
}
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Any help would be appreciated.
Thanks in advance.

Nick