• Maanas Desai cognizant
  • NEWBIE
  • 30 Points
  • Member since 2017
  • Senior Associate projects
  • Cognizant

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 16
    Replies
Hi ,

I am completed the Multiple choice questions for Platform Developer 2 as well as the 4 super badges. How do i link Webaccessor account to Trailhead? Has anyone got any email from salesforce after they completed the 4 super badges?

User-added image
Hi I am getting below error. Can someone tell me what am i missing?

  
Challenge Not yet complete... here's what's wrong: 
Ensure constructProducts returns a list of size cnt of uniquely named Product2 records with all the required fields populated, an Initial Inventory set to 10, and the product family of each record incremented throughout the list.
 
public static list<product2> ConstructProducts(Integer cnt){
        //ToDo: Ensure this method returns a list, of size cnt, of uniquely named Product2 records
        //  with all the required fields populated
        //  and IsActive = true
        //  an Initial Inventory set to 10
        //  and iterating through the product family picklist values throughout the list.
        List<Product2> prods = new List<product2>(); 
        Schema.DescribeFieldResult fieldResult =Product2.Family.getDescribe();
   		List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();

        for(integer i=0;i< cnt;i++)
        {
            for( Schema.PicklistEntry f : ple){
        		product2 p = new product2 (Name = 'Product-'+i +f.getValue() ,Family =f.getValue() , IsActive = true, Initial_Inventory__c =10);
            	prods.add(p);
        	}
        }
        
        return prods;        
    }



 
Hi I am getting below error. Can someone tell me what am i missing?

  
Challenge Not yet complete... here's what's wrong: 
Ensure constructProducts returns a list of size cnt of uniquely named Product2 records with all the required fields populated, an Initial Inventory set to 10, and the product family of each record incremented throughout the list.
 
public static list<product2> ConstructProducts(Integer cnt){
        //ToDo: Ensure this method returns a list, of size cnt, of uniquely named Product2 records
        //  with all the required fields populated
        //  and IsActive = true
        //  an Initial Inventory set to 10
        //  and iterating through the product family picklist values throughout the list.
        List<Product2> prods = new List<product2>(); 
        Schema.DescribeFieldResult fieldResult =Product2.Family.getDescribe();
   		List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();

        for(integer i=0;i< cnt;i++)
        {
            for( Schema.PicklistEntry f : ple){
        		product2 p = new product2 (Name = 'Product-'+i +f.getValue() ,Family =f.getValue() , IsActive = true, Initial_Inventory__c =10);
            	prods.add(p);
        	}
        }
        
        return prods;        
    }



 
I am getting the error:

Ensure that you modify the constructCollaborationGroup method so that it has the correct return type and is not an instance method

Here is that method:
public CollaborationGroup ConstructCollaborationGroup(){
        //ToDo: Ensure this method returns a single Chatter CollaborationGroup
        //    whose Name starts with 'TEST' followed by the INVENTORY_ANNOUNCEMENTS constant
        //    and configured so anyone can join, see and post updates.
        //    
        CollaborationGroup ChatterGroup = new CollaborationGroup(
              Name = 'TEST'+Constants.INVENTORY_ANNOUNCEMENTS,  
              CollaborationType = 'Public',
              CanHaveGuests = true,
              IsArchived = false,
              IsAutoArchiveDisabled = true
        );
        insert ChatterGroup;
        return ChatterGroup;
        
    }
Any ideas on what is wrong. If I run
public void SetupTestData(Integer cnt){
        //ToDo: Ensure this method calls each of the construct methods
        //  and inserts the results for use as test data.
        //  
        CollaborationGroup g = this.ConstructCollaborationGroup();
        List<Account> accounts = this.ConstructAccounts(10);
        List<Contact> contacts = this.ConstructContacts(10,accounts);
        List<Product2> products = this.ConstructProducts(10);
        List<PricebookEntry> pes = this.ConstructPricebookEntries(products);
        List<Order>orders = this.ConstructOrders(10,accounts);
        List<OrderItem> ois = this.ConstructOrderItems(10,pes,orders);
            
    }
All works as expected. I am not sure what I am missing in the ConstructCollaborationGroup method. It is returing a CollaborationGroup and is not static.

Thanks!
I am hit with other issue 'Ensure that page performance is improved by only rerendering the table and error messages when a use clicks the Add button.' I have used actionRegion to rerender the needed table,chart and messages.still it shows issues.
I am curretly doing Advanced Apex Specialist Superbadge..Challenge Not yet complete... here's what's wrong:  Ensure that you've updated product2Extension so that it can be used to override the New Product button.but there no requirment specific to this issue.
On Step 5 of Advanced Apex Specialist (Increase test coverage with unit tests), I am getting the following error when checking the challenge:

Challenge Not yet complete... here's what's wrong: 
Ensure that you create an instance of product2Extension.

Reviewing the logs seems to point to a problem in a different area than testing Product2Extension.

"Assertion Failed: Expected: 10, Actual: 20" - TestDataFactory.VerifyQuantityOrdered line 15

My unit tests that use VerifyQuantityOrdered as requested pass and are working as intended. My debug statements in TestDataFactory for setting up test data and in the unit test in OrderTests are not being logged out in this anonymous block execution, pointing to a direct invocation of TestDataFactory.VerifyQuantityOrdered directly by the Trailhead anonymous Apex, passing two Products and a qtyOrdered value of 20. The first Product passed has a Quanity_Ordered__c value of 0 and the updated product passed has a Quanity_Ordered__c value of 10. Since the qtyOrdered passed is 20, the expectation is:

public static void VerifyQuantityOrdered(Product2 originalProduct, Product2 updatedProduct, Integer qtyOrdered) {
     System.assertEquals(updatedProduct.Quantity_Ordered__c, (originalProduct.Quantity_Ordered__c + qtyOrdered));
}

0 + 20 is not equalling 10 as expected. It seems to me as though the anonymous block in this step is passing the wrong value for updatedProduct.Quantity_Ordered__c.

Any recommendations?
Hi, I am having trouble with the "Attributes and Expressions" module from trailhead.

Here is the challenge:
Create a Lightning Component to display a single item for your packing list.
  • Create a component called campingListItem that displays the name (ui:outputText) and the three custom fields using the appropriate output components.
  • Add an attribute named 'item' for type Camping_Item__c.
I created an component named campingListItem and this is the code:
<aura:component >
    <aura:attribute name="item" type="<my_domain>__Camping_Item__c"/>
    
    <ui:outputText value="{!v.item.Name}"/>
    <ui:outputCheckbox value="{!v.item.<my_domain>__Packed__c}"/>
    <ui:outputCurrency  value="{!v.item.<my_domain>__Price__c}"/>
    <ui:outputNumber value="{!v.item.<my_domain>__Quantity__c}"/>
</aura:component>

The error that I am getting is: "Challenge Not yet complete... here's what's wrong: 
The packingListItem Lightning Component's attribute tag doesn't exist or its attributes are not set correctly."

With this, I tried to create another component, with the name "packingListItem", but It didn't work.

Can anyone help me?

Thanks,