A company wants to streamline their data management process by periodically deleting inactive or obsolete accounts. Manually deleting each account can be time-consuming and prone to errors. Hence, the business requested to implement a mechanism to find list accounts that are inactive or obsolete.
The salesforce team has already implemented a method which finds all inactive and obsolete accounts. The data processing job requires only account ids for efficient data management. The implementation requires an apex method that return list of account ids based on the account that are passed into the method.
Complete the apex code that accepts a list of accounts as input and returns a list of corresponding account ids.
Instructions:
1. The apex method should accept a list of accounts are input parameter.
2. Find the account ids from the given input.
3. Return the account ids from step2.
Example:
//Assume a list variable accountList has list of acccounts
List
//Result
//The accountIdList contians all account ids
Hint:
Use apex list methods to find the number of elements in the list.
Click here to view all apex list practice examples