• Vikas Mishra
  • NEWBIE
  • 120 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 3
    Replies
​Let’s get started by defining an object-specific action. We’ll create an action so that, for example, if your users open the Acme account, they can click on your New Opportunity action. The new opportunity they create will be automatically associated with the Acme account.

First, we need to find and open the Account object.

From Setup, enter Object Manager in the Quick Find box, then click Object Manager.
Enter Account in the Object Manager search box.
Click Account to open the object and then click Buttons, Links, and Actions.

Click New Action.
Select the type of action you want to create. For this example, let’s choose the Create a Record action.

In the above trailhead guidelines, I am not getting object manager when searching in quick find box. 
Let’s get started by defining an object-specific action. We’ll create an action so that, for example, if your users open the Acme account, they can click on your New Opportunity action. The new opportunity they create will be automatically associated with the Acme account.

First, we need to find and open the Account object.

From Setup, enter Object Manager in the Quick Find box, then click Object Manager.
Enter Account in the Object Manager search box.
Click Account to open the object and then click Buttons, Links, and Actions.

Click New Action.
Select the type of action you want to create. For this example, let’s choose the Create a Record action.

In the above trailhead guidelines, I am not getting object manager when searching in quick find box. 
I'm facing problem while Unit test for Apex triggers.
Install a simple Apex trigger, write unit tests that achieves 100% code coverage for the trigger, and run your Apex tests.The Apex trigger to test is called 'RestrictContactByName', and the code is available here. Copy and paste this trigger into your Developer Edition via the Developer Console.
'RestrictContactByName' is a trigger which blocks inserts and updates to any contact with a last name of 'INVALIDNAME'.
The unit tests must be in a separate Apex class called 'TestRestrictContactByName'.
The unit tests must cover scenarios for all lines of code included in the Apex trigger, resulting in 100% code coverage.
Run your test class at least once (via the Developer Console) before attempting to verify this challenge.

from the developer console window I am getting class code coverage 100%, but when checking the challenge it showing the error as 
"Challenge not yet complete... here's what's wrong: 
The 'RestrictContactByName' class did not achieve 100% code coverage via your test methods"




test class I'm running is:-

@isTest
private class TestRestrictContactByName {

    static testMethod void  metodoTest() 
    {
    
        List<Contact> con= new List<Contact>();
        Contact c1 = new Contact(FirstName='Franc', LastName='Riggie' , email='Test@test.com');
        Contact c2 = new Contact(FirstName='Frank', LastName = 'INVALIDNAME',email='Test@test.com');
        con.add(c1);
        con.add(c2);
        
        Test.startTest();
            try
            {
                insert con;
            }
            catch(Exception ee)
            {
            }
        
        Test.stopTest(); 
        
    }
    
}

Kindly suggest.
 
I'm facing problem while Unit test for Apex triggers.
Install a simple Apex trigger, write unit tests that achieves 100% code coverage for the trigger, and run your Apex tests.The Apex trigger to test is called 'RestrictContactByName', and the code is available here. Copy and paste this trigger into your Developer Edition via the Developer Console.
'RestrictContactByName' is a trigger which blocks inserts and updates to any contact with a last name of 'INVALIDNAME'.
The unit tests must be in a separate Apex class called 'TestRestrictContactByName'.
The unit tests must cover scenarios for all lines of code included in the Apex trigger, resulting in 100% code coverage.
Run your test class at least once (via the Developer Console) before attempting to verify this challenge.

from the developer console window I am getting class code coverage 100%, but when checking the challenge it showing the error as 
"Challenge not yet complete... here's what's wrong: 
The 'RestrictContactByName' class did not achieve 100% code coverage via your test methods"




test class I'm running is:-

@isTest
private class TestRestrictContactByName {

    static testMethod void  metodoTest() 
    {
    
        List<Contact> con= new List<Contact>();
        Contact c1 = new Contact(FirstName='Franc', LastName='Riggie' , email='Test@test.com');
        Contact c2 = new Contact(FirstName='Frank', LastName = 'INVALIDNAME',email='Test@test.com');
        con.add(c1);
        con.add(c2);
        
        Test.startTest();
            try
            {
                insert con;
            }
            catch(Exception ee)
            {
            }
        
        Test.stopTest(); 
        
    }
    
}

Kindly suggest.
 
Hi All,

Can anyone please help me with bellow challenge.


Create an Apex trigger for Account that matches Shipping Address Postal Code with Billing Address Postal Code based on a custom field.
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.

For above challenge i tried with following code but looks like it doesnt mach the requirement.

trigger AccountAddressTrigger on Account (before insert, before update) {
    for(Account a : Trigger.new){
        If (a.Match_Billing_Address__c = true) {
            /*ShippingPostalCode = BillingPostalCode;*/
        }   
    } 

}

Please help me