I am trying to query a list of the names of a custom object. I am querying the "Name" field, but every time I try to assign this query to a new variable (List), I get the error: Illegal Assignment from ID to List(string) or List(CustomObject__c) (pending on what type of list I am trying to make it). IS there any reason that the following code is querying as an ID?
public List<CustomObject__c> SNANAList = [SELECT Name FROM CustomObject__c WHERE Account__c = :userinfo.getUserID()].Account__c;
As you can see, the query goes to get the name of each record that is associated to the user's account. The custom Object has a lookup to the Account object. Any help would go a long way.
Many Thanks, CP