Skip to main content
Hi

 

I need help to complete the hands-on challenge for this module title:-

 

Map .NET Concepts to the Lightning Platform.

 

I have created the APEX class and the method.

 

I do not know what to write next :-/

 

public with sharing class AccountUtils {

 

    //public method

 

    public static void accountsByState(string State, string Name)

 

    {

 

        String[] stateName = new String[] {State};

 

          

 

        List<String> accName =  new List<String> {Name};

 

        

 

    } 

 

}

 

Thanks for your help

 

 
4 answers
  1. Mar 21, 2020, 12:17 PM
    Hi,

     

    I think you are missing some of the points like method should return List<Account> and that too Account's Id and name. 

     

    Something like this :-

     

    public class AccountUtils {

     

        public static List<Account> accountsByState (String state){

     

        

     

            List<Account> lstAcc= new List<Account>();

     

            lstAcc  = [SELECT id,Name FROM Account WHERE BillingState =:state]; 

     

            return lstAcc ;

     

        }

     

    }

     

    Please let me know if it helps.

     

    Regards,

     

    Amit Karan Singh 
0/9000