Create a BankAcct and CreateContactFromCan Class
Follow Along with Trail Together
Want to follow along with an expert as you work through this step? Take a look at this video, part of the Trail Together series.
(This clip starts at the 8:08 minute mark, in case you want to rewind and watch the beginning of the step again.)
Create Apex Classes
Create an Apex class named BankAcct. Give the BankAcct class three attributes: balance, acctName, and acctType. Include a method named makeDeposit to set the account balance.
- In the Developer Console, click File | New | Apex Class.
- In the New Apex Class window, enter
BankAcct
and then click OK. - Replace the code in the Enter Apex Code window with this code:
- Click File | Save.
Create a class named CreateContactFromCan and a method named createContact.
- Click File | New | Apex Class.
- In the New Apex class window, type
CreateContactFromCan
and then click OK. - Replace the code in the Enter Apex Code window with this code:
- Save the CreateContactFromCan class.