Trigger For After Update In Salesforce Trailhead

Trigger For After Update In Salesforce Trailhead Average ratng: 9,7/10 7266 reviews
Help
  1. Salesforce Trailhead Admin
  2. Salesforce Trailhead Free
  3. Salesforce Trailhead Review

A trigger in Salesforce is very important, Let we see the trigger in detail Trigger Definition: The trigger is a apex code that gets fired whenever specific DML operations are performed on an object record, It allows to developers to check programmatical check for duplicate records, updates. If certain conditions are met, the trigger updates the opportunity description. In this example, the update statement is inefficiently called once for each opportunity. If a bulk account update operation fired the trigger, there can be many accounts. Salesforce Interview Questions on Trigger. What is a Trigger? Trigger can invoke Apex code, they come in handy when we want to perform some custom task just before or after a record is either created updated or deleted.

Active1 year, 7 months ago

The code itself doesn't give any errors, but anytime I run it Trailhead gives me this message:

'Challenge not yet complete.. here's what's wrong: Executing the trigger did not work as expected. '

Here are the instructions:

For this challenge, you need to create a trigger that, before insert or update, checks for a checkbox. If the checkbox field is true, it 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.

My code:

kittykittybangbang
2,0734 gold badges11 silver badges24 bronze badges
Tyler PavlovicTyler Pavlovic

3 Answers

Chandresh KoyaniChandresh Koyani

trigger AccountAddressTrigger on Account (before insert,before update) {

}

Gunjan RanpariyaGunjan Ranpariya

First need to create check box field with name Match billing address in Account tab then open developer console and write the code and save it .Finally check that whether its working or not again in ur salesforce instance

here is the code :

trigger accountAddressTrigger on Account (before insert, before update) {

Salesforce Trailhead Admin

}

chinnichinni

Not the answer you're looking for? Browse other questions tagged triggerssalesforceapexapex-trigger or ask your own question.

Posted by3 years ago
Archived

I have a custom Call Planner object where the user can associate the 'Call Plan' record with an Account, Opportunity, Lead, or Contact, using Lookup Fields.

Salesforce

When creating a new Call Plan, I want to make the Account field read-only, then have them enter the opportunity (or contact, or lead), and have the account populate automatically.

Salesforce Trailhead Free

Currently, I'm trying this:

Lagu yang satu ini memang gak ada matinya guys! Free download me inikah namanya cinta. - - - - - - - - - - - Hi eclat performing an acoustic cover of Inikah Cinta by ME - - - - - - - - - - - ECLAT STORY ARE @eclatstoryofficial @yosua_gunawan @jeftajasson @willyanggawinata @claraayusheila @louisxanderliang - - - - - - - - - - - SUBSCRIBE!

I'm assuming I need to create a string to store the Opportunity ID, then somehow use it to look up the Account ID. But I'm not sure how to proceed.

For example, installing AutoCAD 2010 as a point product requires product key 001B1, but installing AutoCAD 2010 from the AutoCAD Revit Architecture Suite 2010 requires product key 241B1. The same version of AutoCAD is in both software packages but the product key differentiates one package from the other. Xin file crack autocad 2010.

Salesforce Trailhead Review

7 comments