I have created a screen flow and this flow will invoke once delete button is clicked, I have added a screen element in which records of selected objects are shown in the form of data table. And I only want to delete those records that are selected in that data table screen. Once the data is deleted I want to invoke a method from apex class, that class will make sure that the selected records are deleted. I want to query that records which are deleted. So how will I query those records and how to get that variable in apex class which is created in flow and contains all selected rows of data table that are deleted.
@Shubham Sarkar Basically you can all Apex method and pass the record variable as a parameter
in Apex we can create a method with Invoice Variable and accepting List of Records
see the example in below link
https://help.salesforce.com/s/articleView?id=sf.flow_build_extend_apex.htm&type=5