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
anna 5anna 5 

Wrong value is set to List<id>

hallo.

I'm trying to this trailhead.
■Use Future Methods
https://trailhead.salesforce.com/ja/modules/asynchronous_apex/units/async_apex_future_methods

I wrote berow code for test class,
but the 'AccountProcessor' class did not achieve 100% code coverage via your test methods.
@isTest
public class AccountProcessorTest {
    @isTest
    public static void AccountProcessorTest(){
        
        List<Account> accounts = [Select Id, Name from Account];
        List<Id> ids = new List<Id>();
        for(account a : accounts){
            ids.add(a.Id);
        }
        Test.startTest();
        AccountProcessor.countContacts(ids);
        Test.stopTest();
        
    }
}
So I tried to debug with checkpoint,
It seemed that 'aid' contains the Account record itself, not it's id

User-added image

How can I set Account.id to List<id>?

Thak you.
Best Answer chosen by anna 5
NagendraNagendra (Salesforce Developers) 
Hi Anna,

Sorry for this issue you are encountering.

May I suggest you please check with below link from the forums community with a similar discussion and a suggested workaround which might help you further with the above requirement. Hope this helps.

Thanks,
Nagendra

All Answers

NagendraNagendra (Salesforce Developers) 
Hi Anna,

Sorry for this issue you are encountering.

May I suggest you please check with below link from the forums community with a similar discussion and a suggested workaround which might help you further with the above requirement. Hope this helps.

Thanks,
Nagendra
This was selected as the best answer
anna 5anna 5
Hi Nagendra,
In that way I cleared challenge. Thanks!