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
Leonard CadetLeonard Cadet 

Invoke Flow Variables Into Apex code

I am working on building the framework to use a variable that is passed from a button to a flow and then from the flow to Apex code so I can use that variable in my soql query statment in my Apex code. 

What do I need to correct in my code to make this possible?
 
Public class TestLC {


    @InvocableMethod(
    label = 'Test Invoc'
    description = 'This is this is a test to confirm I can pull put info into into a variable'
    )
 
    List<CCMI__Milestone_Task__c> TempTask = 
    [SELECT 
    CCMI__Milestone_Project__c,
    Id,
    Name 
    FROM CCMI__Milestone_Task__c WHERE CCMI__Milestone_Project__c = :LCID
     ];

     For(CCMI__Milestone_Task__c TT:TempTask){
       System.debug(LCID); 
       System.debug(LGID);
       System.debug(TT.Id);
    }


    global class RecordRequest{

        @InvocableVariable(required=true)
        global String LCID;

        @InvocableVariable(required=true)
        global String LGID;
    }

   
    
}