Salesforce Apex: How do I set a field to a variable?
I have built an apex schedule class that runs everyday. If an account has an account review date for commissions is two weeks (14 days) away the scheduler will send an email to our Sales Department. The email contains a link to a flow. The flow starts a process to calculate the new commission. To do that, the flow needs to understand to pull information from the account that triggered the email to be sent, the account that has an account review date in 2weeks.

Currently, the email sends out fine with the link to the flow. The link to the flow works, but once you get to the flow, the flow does not know/understand what account it should be pulling information from. 

MY SOLUTION SO FAR: In plain English, I want to make the account that has the account with the review date 14 days away equal to the variable {!vaAccountID} . (This variable is referenced in the record lookup of the flow the email being sent has a link to). 

How do I make the account id field I was just referencing (the account with the review date 14 days away equal to the variable {!vaAccountID} in Salesforce?   

Salesforce does not give me an API name for account Id....is it simply account.id?

My guess would be Account_id = {!vaAccountID}

I want to do this so when I click on the link in the email to the flow, the flow understands what account to pull information from. The variable {!vaAccountID} is populated within the flow with the account information. 



     for(Account acc : [SELECT Id FROM Account WHERE Next_Account_Review_Date__c = : system.Today().addDays(14)])
          {
          = {!vaAccountID}
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); 
        mail.setTemplateId('00XF0000000LfE0'); 
        mail.setTargetObjectId('005J0000000JWYx'); 
        mail.setSaveAsActivity(false);
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] {mail }); 
        }
        }
        
        
        }
Salesforce Apex: How do I set a field to a variable?
===

I have built an apex schedule class that runs everyday. If an account has an account review date for commissions is two weeks (14 days) away the scheduler will send an email to our Sales Department. The email contains a link to a flow. The flow starts a process to calculate the new commission. To do that, the flow needs to understand to pull information from the account that triggered the email to be sent, the account that has an account review date in 2weeks.

Currently, the email sends out fine with the link to the flow. The link to the flow works, but once you get to the flow, the flow does not know/understand what account it should be pulling information from. 

MY SOLUTION SO FAR: In plain English, I want to make the account that has the account with the review date 14 days away equal to the variable {!vaAccountID} . (This variable is referenced in the record lookup of the flow the email being sent has a link to). 

How do I make the account id field I was just referencing (the account with the review date 14 days away equal to the variable {!vaAccountID} in Salesforce?   

Salesforce does not give me an API name for account Id....is it simply account.id?

My guess would be Account_id = {!vaAccountID}

I want to do this so when I click on the link in the email to the flow, the flow understands what account to pull information from. The variable {!vaAccountID} is populated within the flow with the account information. 



     for(Account acc : [SELECT Id FROM Account WHERE Next_Account_Review_Date__c = : system.Today().addDays(14)])
          {
          = {!vaAccountID}
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); 
        mail.setTemplateId('00XF0000000LfE0'); 
        mail.setTargetObjectId('005J0000000JWYx'); 
        mail.setSaveAsActivity(false);
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] {mail }); 
        }
        }
        
        
        }