function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
VIJAY J 7VIJAY J 7 

Unexpected error while executing a trigger

For this challenge, you need to create a trigger that, before insert or update, checks for a checkbox, and if the checkbox field is true, sets the Shipping Postal Code (whose API name is ShippingPostalCode) to be the same as the Billing Postal Code (BillingPostalCode).
The Apex trigger must be called 'AccountAddressTrigger'.
The Account object will need a new custom checkbox that should have the Field Label 'Match Billing Address' and Field Name of 'Match_Billing_Address'. The resulting API Name should be 'Match_Billing_Address__c'.
With 'AccountAddressTrigger' active, if an Account has a Billing Postal Code and 'Match_Billing_Address__c' is true, the record should have the Shipping Postal Code set to match on insert or update.

the error is : There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [Type__c]: [Type__c]
 
Best Answer chosen by VIJAY J 7
sfdcMonkey.comsfdcMonkey.com
hi VIjay
you go this error because in your account object you have a required field with name Type (api name is Type__c)
for solve this
go to setup ---> quick find box --> type Account  and select fields in account section
User-added image



after select fields go to Account Custom Fields & Relationships section and find field with name Type (api name is Type__c) edit this field and uncheck the Required check box
User-added image
And save it ,and try again
i hop it helps you
Mark it best answere if it helps you so it make proper solution for others :)
Thanks

All Answers

sfdcMonkey.comsfdcMonkey.com
hi VIjay
you go this error because in your account object you have a required field with name Type (api name is Type__c)
for solve this
go to setup ---> quick find box --> type Account  and select fields in account section
User-added image



after select fields go to Account Custom Fields & Relationships section and find field with name Type (api name is Type__c) edit this field and uncheck the Required check box
User-added image
And save it ,and try again
i hop it helps you
Mark it best answere if it helps you so it make proper solution for others :)
Thanks
This was selected as the best answer
VIJAY J 7VIJAY J 7
thank u for taking time to answer my question. Wow. Just a tick changed the error into a succesfull one. thanks buddy.