๋ชฉ๋ก ๋ง๋ค๊ธฐ
Trail Together์ ํจ๊ป ์์๋ณด๊ธฐ
์ด ๋จ๊ณ๋ฅผ ์ ๋ฌธ๊ฐ์ ํจ๊ป ์งํํ๊ณ ์ถ์ผ์ ๊ฐ์? Trail Together ์๋ฆฌ์ฆ์ ์ผ๋ถ์ธ ์ด ๋น๋์ค๋ฅผ ์์ฒญํ์ธ์.
(์ด ์์์ 13๋ถ 30์ด๋ถํฐ ์์ํฉ๋๋ค. ๋จ๊ณ ์์ ๋ถ๋ถ์ผ๋ก ๋๋๋ ค ๋ค์ ์์ฒญํ๋ ค๋ ๊ฒฝ์ฐ ์ฐธ๊ณ ํ์ธ์.)
๋ชฉ๋ก ๋ง๋ค๊ธฐ ๋ฐ ์กฐ์
์ด๋ฆ์ด bankAccts์ธ ๋ชฉ๋ก์ ์ธ์คํด์คํํ๊ณ ๋ BankAcct ๊ฐ์ฒด๋ฅผ ๋ชฉ๋ก์ ์ถ๊ฐํฉ๋๋ค.
- Execute Anonymous(์ต๋ช
์คํ) ์ฐฝ์ ์ฝ๋๋ค.
- ๊ธฐ์กด ์ฝ๋๋ฅผ ๋ค์ ์ฝ๋๋ก ๋ฐ๊ฟ๋๋ค.
//From the BankAcct class, instantiate an object named chkAcct BankAcct chkAcct = new BankAcct(); //Set the accttype attribute of the chkAcct object to Checking chkAcct.accttype = 'Checking'; //Set the acctName attribute of the chkAcct object to D.Castillo-Chk chkAcct.acctName = 'D.Castillo-Chk '; //Invoke the makeDeposit method with 150 as the argument chkAcct.makeDeposit(150); //From the BankAcct class, instantiate an object named savAcct BankAcct savAcct = new BankAcct(); //Set the accttype attribute of the savAcct object to Savings savAcct.accttype = 'Savings'; //Set the acctName attribute of the savAcct object to D.Castillo-Sav savAcct.acctName = 'D.CastilloโSav'; //Invoke the makeDeposit method with 220 as the argument savAcct.makeDeposit(220); //From the List class, instantiate a BankAcct List object named bankAccts List<BankAcct> bankAccts = new List<BankAcct>(); System.debug('The BankAcct List has ' + bankAccts.size() + ' bank accounts.'); //Add the chkAcct object to the bankAccts list bankAccts.add(chkAcct); //Add the savAcct object to the bankAccts list bankAccts.add(savAcct); System.debug('The BankAcct List has ' + bankAccts.size() + ' bank accounts.'); System.debug('Here is the list: ' + bankAccts); - Open Log(๋ก๊ทธ ์ด๊ธฐ)๊ฐ ์ ํ๋์ด ์๋์ง ํ์ธํ ํ Execute(์คํ)๋ฅผ ํด๋ฆญํฉ๋๋ค. ์คํ ๋ก๊ทธ๊ฐ ์ด๋ฆฝ๋๋ค.
- Debug Only(๋๋ฒ๊ทธ๋ง)๋ฅผ ์ ํํฉ๋๋ค.
- ๋๋ฒ๊ทธ ๋ฉ์์ง๋ฅผ ๊ฒํ ํ ํ ๋ก๊ทธ๋ฅผ ๋ซ์ต๋๋ค.
createContact ๋ฉ์๋์์ Contact List(์ฐ๋ฝ์ฒ ๋ชฉ๋ก) ๊ฐ์ฒด๋ฅผ ์ธ์คํด์คํํ๊ณ ์ด๋ฆ์ด candsFromTrigger์ธ Candidate List(ํ๋ณด ๋ชฉ๋ก) ๊ฐ์ฒด๋ฅผ ์ธ์๋ก ์๋ฝํฉ๋๋ค.ย
- Developer Console์์ CreateContactFromCan ํด๋์ค๋ฅผ ์ด๊ณ ๊ธฐ์กด ์ฝ๋๋ฅผ ๋ค์ ์ฝ๋๋ก ๋ฐ๊ฟ๋๋ค.
public with sharing class CreateContactFromCan { //Declare a method that returns void and accepts a Candidate list named candsFromTrigger public void createContact (List<Candidate__c> candsFromTrigger){ //Instantiate a Contact list named conList List<Contact> conList = new List<Contact>(); } } - CreateContactFromCan ํด๋์ค๋ฅผ ์ ์ฅํฉ๋๋ค.
