You need to sign in to do that
Don't have an account?
Swamy Naren
Get Started with Apex Triggers
Hi All,
I am getting following error message:
Challenge not yet complete... here's what's wrong:
A field with an API Name 'Match_Billing_Address__c' does not exist on the Account object
my code is as follows:
trigger AccountAddressTrigger on Account (before insert, before update) {
for(Account a : Trigger.New) {
if(a.Match_Billing_Address__c==true){a.ShippingPostalCode=a.BillingPostalCode;}
}
}
Thanks in Advance
I am getting following error message:
Challenge not yet complete... here's what's wrong:
A field with an API Name 'Match_Billing_Address__c' does not exist on the Account object
my code is as follows:
trigger AccountAddressTrigger on Account (before insert, before update) {
for(Account a : Trigger.New) {
if(a.Match_Billing_Address__c==true){a.ShippingPostalCode=a.BillingPostalCode;}
}
}
Thanks in Advance
I trust you are doing very well.
Please follow below steps:
- Create a custom field: Setup-> Object Manager-> Account -> Fields and Relationships
- Select New --> Field Type (Checkbox)
- Enter Name as Match Billing Address
- Checkbox should be Unchecked
- Save.
Now write the below code, it is working without any errorsI hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future.
Thanks and Regards,
Khan Anas
All Answers
I trust you are doing very well.
Please follow below steps:
- Create a custom field: Setup-> Object Manager-> Account -> Fields and Relationships
- Select New --> Field Type (Checkbox)
- Enter Name as Match Billing Address
- Checkbox should be Unchecked
- Save.
Now write the below code, it is working without any errorsI hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future.
Thanks and Regards,
Khan Anas
Looks like you do not have "Match_Billing_Address__c" this field on Account object.
Create this field on account as boolean type and then check with new Account creation.
Actually i forgot to give space between MatchBillingAddress