• Irina Aristova 10
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 4
    Replies
I am getting this error on step 5: Challenge Not yet complete... here's what's wrong:  Ensure that you create the OrderUpdate_UnitTest test method with the proper declaration and proper access modifier, to ensure best practices.
I tried make it public, private, using @isTest, test method, still having same error.

Here is the code:@isTest (seeAllData=false)
private class OrderTests {

    @testSetup
    static void SetupTestData(){
        TestDataFactory.InsertTestData(5);
    }
   
    @isTest
     public static void OrderUpdate_UnitTest(){

       SetupTestData();
        Test.startTest();
            Order order = [Select name,Status, Id from Order limit 1];
            Product2 prod = [Select Quantity_Ordered__c, Name, Id from Product2 limit 1];
        
            order.Status = Constants.ACTIVATED_ORDER_STATUS;
            update order;
        
            Product2 currentProducts = [Select Quantity_Ordered__c, Name, Id from Product2 limit 1];
        
            TestDataFactory.VerifyQuantityOrdered(prod,currentProducts,Constants.DEFAULT_ROWS);
            System.assertNotEquals(null, currentProducts);
        Test.stopTest();
    }
}
I created a  custom clone button for opportunity, using the following code: {!URLFOR( $Action.Opportunity.Clone , Opportunity.Id , ["opp3"=Opportunity.Name+"-Copy","opp9"="",,"00N54000000aRB3"=""...,"retURL"= URLFOR( $Action.Opportunity.View ,) ], true)}

One of the requirement is to give some fields the new values or empty them. When the button is clicked the new screen with cloned opportunity is opened and some fields got the new values except Date and Pick List (the ones that should be blank). I am not able to put a blank value to a date field or pick list. In the example, I provided opp9 is a ClosedDate. If I put any non null value, the clone will be created with a new value in this field, if I put ="', for a date or pick list, it's not working, the value from original opportunity stays on a cloned one.
Does anyone knows how to empty date and pick list on a clone? 
I created a  custom clone button for opportunity, using the following code: {!URLFOR( $Action.Opportunity.Clone , Opportunity.Id , ["opp3"=Opportunity.Name+"-Copy","opp9"="",,"00N54000000aRB3"=""...,"retURL"= URLFOR( $Action.Opportunity.View ,) ], true)}

One of the requirement is to give some fields the new values or empty them. When the button is clicked the new screen with cloned opportunity is opened and some fields got the new values except Date and Pick List (the ones that should be blank). I am not able to put a blank value to a date field or pick list. In the example, I provided opp9 is a ClosedDate. If I put any non null value, the clone will be created with a new value in this field, if I put ="', for a date or pick list, it's not working, the value from original opportunity stays on a cloned one.
Does anyone knows how to empty date and pick list on a clone? 
 
I am getting this error on step 5: Challenge Not yet complete... here's what's wrong:  Ensure that you create the OrderUpdate_UnitTest test method with the proper declaration and proper access modifier, to ensure best practices.
I tried make it public, private, using @isTest, test method, still having same error.

Here is the code:@isTest (seeAllData=false)
private class OrderTests {

    @testSetup
    static void SetupTestData(){
        TestDataFactory.InsertTestData(5);
    }
   
    @isTest
     public static void OrderUpdate_UnitTest(){

       SetupTestData();
        Test.startTest();
            Order order = [Select name,Status, Id from Order limit 1];
            Product2 prod = [Select Quantity_Ordered__c, Name, Id from Product2 limit 1];
        
            order.Status = Constants.ACTIVATED_ORDER_STATUS;
            update order;
        
            Product2 currentProducts = [Select Quantity_Ordered__c, Name, Id from Product2 limit 1];
        
            TestDataFactory.VerifyQuantityOrdered(prod,currentProducts,Constants.DEFAULT_ROWS);
            System.assertNotEquals(null, currentProducts);
        Test.stopTest();
    }
}

User-added image


Code base:
@isTest(seeAllData =False)
public class OrderTests {
    
    @testSetup 
    public static void SetupTestData(){
        TestDataFactory.InsertTestData(1);
    }

    Static testmethod void OrderUpdate_UnitTest(){
        Test.startTest();
        Product2 originalproduct = [SELECT Id, Family, Name, Quantity_Ordered__c, Quantity_Remaining__c FROM Product2 LIMIT 1];
        Order od = [SELECT id, Status FROM Order LIMIT 1];
        
        
        od.status = constants.ACTIVATED_ORDER_STATUS;
        Update od;
        
        
        Product2 updatedProduct = [SELECT Family,Id,Name,Quantity_Ordered__c ,Quantity_Remaining__c FROM Product2 WHERE id=:originalproduct.Id LIMIT 1];
        
        TestDataFactory.VerifyQuantityOrdered(originalproduct,updatedProduct,Constants.DEFAULT_ROWS);
        Test.stopTest();
    }
}
Thanks in advance.
 Conference Management App - Create a Lightning Component with Server-Side Apex Controller:

Step 5: Add Component to the Speaker Record Page
Click App Default and then Assign as App Default.
Select the Conference app, then click Next and then Save.
Question: Does anyone know why Conference Management App is not listed for selection?

User-added image
I am also getting this error when I verify the hands on challenge:Note all APEX codes saved without errors. and all other steps worked.
Step not yet complete... here's what's wrong:
There was an unexpected error in your org which is preventing this assessment check from completing: System.QueryException: List has no rows for assignment to SObject

Thanks in advance for your help.
I created a  custom clone button for opportunity, using the following code: {!URLFOR( $Action.Opportunity.Clone , Opportunity.Id , ["opp3"=Opportunity.Name+"-Copy","opp9"="",,"00N54000000aRB3"=""...,"retURL"= URLFOR( $Action.Opportunity.View ,) ], true)}

One of the requirement is to give some fields the new values or empty them. When the button is clicked the new screen with cloned opportunity is opened and some fields got the new values except Date and Pick List (the ones that should be blank). I am not able to put a blank value to a date field or pick list. In the example, I provided opp9 is a ClosedDate. If I put any non null value, the clone will be created with a new value in this field, if I put ="', for a date or pick list, it's not working, the value from original opportunity stays on a cloned one.
Does anyone knows how to empty date and pick list on a clone?