0

I have an event that is triggered on a button click. This event calls an Apex class, passing an argument with it. Without the argument, the code runs fine, however when I pass in the parameter I am met with the below error. I may be missing some simple syntax, any help would be greatly appreciated!

Error: An internal server error has occurred Error ID: 1765797339-127362

handleRowAction(event)
    {
        const row = event.detail.row;
        this.tList = searchTacitcContacts(row.PCID);
        this.phoneModalOpen = true;
    }
@AuraEnabled(cacheable=true)
    public static List<String> searchTacticContacts(String PCID)
    {
        List<String> TacticList = new List<String>();
        List<Tactic_Contact__c> startList = [SELECT Tactic_Name__c, Tactic_Contact__c.Project_Contact__r.Name FROM Tactic_Contact__c WHERE Tactic_Contact__c.Project_Contact__r.Name = :PCID];
        for(Tactic_Contact__c item : startList)
            TacticList.add((String)item.Tactic_Name__c);
        return TacticList;
    }

1 Answer 1

0

You need to pass the Parameters as an object with parameter names...

this.tList = searchTacitcContacts({ PCID: row.PCID });
1
  • 1
    Worked great, thank you very much for the help! I come from a Java background so this is still quite new to me.
    – JLadage
    Jun 13, 2022 at 18:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .