본문 바로가기
Salesforce/Trailhead

[Developer Beginner] Apex Triggers | Get Started with Apex Triggers

by proudofch 2021. 3. 22.

오 통과ㅋ

trigger AccountAddressTrigger on Account (before insert, before update) {
	//BillingPostalCode
	//ShippingPostalCode
	//Match_Billing_Address__c is true,
    // 위는 정확한 API명
	//billing postal code true && match_billing accress__c true일 때
    //shipping postal code를 세팅할 것
    
    for(Account a : Trigger.New) {
        if(a.Match_Billing_Address__c == true && a.BillingPostalCode != '') {
            a.ShippingPostalCode = a.BillingPostalCode;
        }
    }

}

댓글