You need to sign in to do that
Don't have an account?
Forcedotcom737
Help me understand line of code which is a method that accepts a list as a parameter
With reference to the line of code (method createContact) below I am wondering where List<candidate_c> candidateFromTrigger is created? This doesn’t seem to follow the create new list syntax
public void createContact(List<Candidate_c> candidateFromTrigger)
Is this statement not required somewhere in the code to create the new List candidateFromTrigger
E.g List<candidate_c> candidateFromTrigger = new List <candidate_c>(); (I was expecting this kind of stament in the code. I am new to apex & coding)
Goal of the code:
Access method from trigger by passing trigger.new to createContact
A.createContact(trigger.new)
public void createContact(List<Candidate_c> candidateFromTrigger)
Is this statement not required somewhere in the code to create the new List candidateFromTrigger
E.g List<candidate_c> candidateFromTrigger = new List <candidate_c>(); (I was expecting this kind of stament in the code. I am new to apex & coding)
Goal of the code:
Access method from trigger by passing trigger.new to createContact
A.createContact(trigger.new)
The structure of the code is MethodName(Parameter type) the method create contact will accept the List of candidate record as a parameter, If you pass the list of candiadate record to that method it will store the parameter value in the variable candidateFromTrigger. You can use the same variable inside the createContact method to process your business logic.