function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Javier FernandezJavier Fernandez 

Illegal Assignment from String to List TSF Object

Im creating this code from scratch but I'm getting and error: Illegal assignment from List<TSF_vod__c> to List<String>

public static String getMyObjAB() { 
        List <String> TSFObjetivos = new List<String> ();
        List <String> Objterr = 
        [SELECT Call_Reminder_TSF__c from TSF_vod__c where Account_vod__c = '0015000001Bbyb9AAB'];
        return MyObjAB;
    }

What can I do?
Nicole RebeloNicole Rebelo
Change this line from:

        List <String> Objterr = 
        [SELECT Call_Reminder_TSF__c from TSF_vod__c where Account_vod__c = '0015000001Bbyb9AAB'];

to this:

        List <TSF_vod__c> Objterr = 
        [SELECT Call_Reminder_TSF__c from TSF_vod__c where Account_vod__c = '0015000001Bbyb9AAB'];
 
Amit Chaudhary 8Amit Chaudhary 8
Update your code like below

public static String getMyObjAB() { 
        List <String> TSFObjetivos = new List<String> ();
        List <TSF_vod__c> Objterr = 
        [SELECT Call_Reminder_TSF__c from TSF_vod__c where Account_vod__c = '0015000001Bbyb9AAB'];
        return MyObjAB;
    }

Let us know if this will help you

 
Javier FernandezJavier Fernandez
I need to replace the text value '0015000001Bbyb9AAB' with the value of the Account_vod field coming from tha CALL objetc. What sintax  should I use?