I need a comma separated list of Names of a custom object. I tried the below code.
List<string> lstNames = new List<string>();
lstNames = [Select Name from A__c where field__c =: objB.Id ];
string Names = string.join(lstNames,',')
It gives me an error that Illegal assignment from List to List. I know it is because I am trying to convert a list of A__c to a list of string. Is there a way available to convert a list of object to a list of string without iterating through each record or to get a comma separated list of values without iteration?