• ManishKSingh
  • NEWBIE
  • 40 Points
  • Member since 2015
  • Salesforce Developer

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 6
    Replies
Can anyone tell me, how to capturing save events on Lightning detail page inside a custom lightning component ?

Thanks in advance
Can anyone tell me, how i find my custom navigation menu in Lightning Experience of Winter 17.?
Can anyone tell me, how i use html5 'video' tag in my custom lightning component to play video file ?


Any help will be greatly appreciated.
Can anyone help me to get code coverage for below 'if' condition..

if(Date.today().month()==1){ 
}

Any help will be greatly appreciated.
I am creating unit test class for quote line item and it execute without any exception in sandbox but when i validate it in the production organization of salesforce, it's fail with following error "System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [UnitPrice]: [UnitPrice]
Stack Trace: Class.Test_TriggerRollupPriceAndCost.testRollupPriceCost: line 48, column 1".

but [UnitPrice] field is already defined in the below class.

@isTest(seeAlldata=true)
public class Test_TriggerRollupPriceAndCost {
    static testmethod void testRollupPriceCost(){
    
        Account a=new Account(Name='Test');
        insert a;
        
        Opportunity o=new Opportunity();
        o.Name='TestOpp';
        o.AccountId=a.Id;
        o.StageName='Test';
        o.CloseDate=System.Today().addMonths(1);
        o.LeadSource='test';
        o.District_Sales_Rep__c=[Select Id from User where Name='Salesforce Uploader' limit 1].id;
        o.Product_Line__c='Tet';
        o.Type='Test';
        o.Vertical_Market__c='Test';
        o.Comm_Split_Primary__c=100.00;
        insert o;       
        
        Product2 p1 = new Product2();
        p1.Name='Test8';
        p1.Productcode='PO16';
        p1.IsActive = true;        
        insert p1;      

        Pricebook2 standardPB = [Select Id from Pricebook2 where isStandard=true limit 1];
        
        PricebookEntry pbe = new PricebookEntry();
        pbe.IsActive = true;
        pbe.Product2ID = p1.Id;
        pbe.Pricebook2Id = standardPB.Id;
        pbe.UnitPrice = 200;        
        //pbe.UseStandardPrice = false;
        insert pbe;
                
        Quote q=new Quote();
        q.Name='Test';        
        q.OpportunityId=o.Id;
        q.Pricebook2Id=standardPB.Id;
        insert q;
       
        QuoteLineitem q1=new QuoteLineItem();        
        q1.PricebookEntryId=pbe.Id;
        q1.Quantity=1;        
        q1.UnitPrice=pbe.UnitPrice;
        q1.QuoteId=q.Id;
        insert q1;      // exception is here..
        delete q1;
    }   
}

Plz help me to resolve this issue

Thanks in advance.
Can anyone tell me, how to capturing save events on Lightning detail page inside a custom lightning component ?

Thanks in advance
Can anyone tell me, how i find my custom navigation menu in Lightning Experience of Winter 17.?
Can anyone help me to get code coverage for below 'if' condition..

if(Date.today().month()==1){ 
}

Any help will be greatly appreciated.
I am creating unit test class for quote line item and it execute without any exception in sandbox but when i validate it in the production organization of salesforce, it's fail with following error "System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [UnitPrice]: [UnitPrice]
Stack Trace: Class.Test_TriggerRollupPriceAndCost.testRollupPriceCost: line 48, column 1".

but [UnitPrice] field is already defined in the below class.

@isTest(seeAlldata=true)
public class Test_TriggerRollupPriceAndCost {
    static testmethod void testRollupPriceCost(){
    
        Account a=new Account(Name='Test');
        insert a;
        
        Opportunity o=new Opportunity();
        o.Name='TestOpp';
        o.AccountId=a.Id;
        o.StageName='Test';
        o.CloseDate=System.Today().addMonths(1);
        o.LeadSource='test';
        o.District_Sales_Rep__c=[Select Id from User where Name='Salesforce Uploader' limit 1].id;
        o.Product_Line__c='Tet';
        o.Type='Test';
        o.Vertical_Market__c='Test';
        o.Comm_Split_Primary__c=100.00;
        insert o;       
        
        Product2 p1 = new Product2();
        p1.Name='Test8';
        p1.Productcode='PO16';
        p1.IsActive = true;        
        insert p1;      

        Pricebook2 standardPB = [Select Id from Pricebook2 where isStandard=true limit 1];
        
        PricebookEntry pbe = new PricebookEntry();
        pbe.IsActive = true;
        pbe.Product2ID = p1.Id;
        pbe.Pricebook2Id = standardPB.Id;
        pbe.UnitPrice = 200;        
        //pbe.UseStandardPrice = false;
        insert pbe;
                
        Quote q=new Quote();
        q.Name='Test';        
        q.OpportunityId=o.Id;
        q.Pricebook2Id=standardPB.Id;
        insert q;
       
        QuoteLineitem q1=new QuoteLineItem();        
        q1.PricebookEntryId=pbe.Id;
        q1.Quantity=1;        
        q1.UnitPrice=pbe.UnitPrice;
        q1.QuoteId=q.Id;
        insert q1;      // exception is here..
        delete q1;
    }   
}

Plz help me to resolve this issue

Thanks in advance.