• cesarhanke
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
I did try the query in Force.com Explore and get the result whoever when I ran the test this error comes up.  Please help!!!
Here is my code:

@istest
private class QuoteProductEntryTests {

    static testMethod void theTests(){
      
          
        QuoteLineItem qli = [select Id, PricebookEntryId, PriceBookEntry.Product2Id, QuoteId, Quote.OpportunityId from QuoteLineItem limit 1];
             
              
        ////////////////////////////////////////
        //  test QuoteProductEntry
        ////////////////////////////////////////
      
        // load the page     
        PageReference pageRef = Page.QuoteProductEntry;
        pageRef.getParameters().put('Id',qli.QuoteId);
        Test.setCurrentPageReference(pageRef);
      
        // load the extension
        QuoteitemExtension oPEE = new QuoteItemExtension(new ApexPages.StandardController(qli.Quote));
      
        // test 'getChosenCurrency' method
        if(UserInfo.isMultiCurrencyOrganization())
            System.assert(oPEE.getChosenCurrency()!='');
        else
            System.assertEquals(oPEE.getChosenCurrency(),'');

        // we know that there is at least one line item, so we confirm
        Integer startCount = oPEE.ShoppingCart.size();
        system.assert(startCount>0);

        //test search functionality without finding anything
        oPEE.searchString = 'michaelforce is a hip cat';
        oPEE.updateAvailableList();
        system.assert(oPEE.AvailableProducts.size()==0);
      
        //test remove from shopping cart
        oPEE.toUnselect = qli.PricebookEntryId;
        oPEE.removeFromShoppingCart();
        system.assert(oPEE.shoppingCart.size()==startCount-1);
      
        //test save and reload extension
        oPEE.onSave();
        oPEE = new QuoteItemExtension(new ApexPages.StandardController(qli.Quote));
        system.assert(oPEE.shoppingCart.size()==startCount-1);
      
        // test search again, this time we will find something
        oPEE.searchString = qli.PricebookEntry.Name;
        oPEE.updateAvailableList();
        system.assert(oPEE.AvailableProducts.size()>0);     

        // test add to Shopping Cart function
        oPEE.toSelect = oPEE.AvailableProducts[0].Id;
        oPEE.addToShoppingCart();
        system.assert(oPEE.shoppingCart.size()==startCount);
              
        // test save method - WITHOUT quanitities and amounts entered and confirm that error message is displayed
        oPEE.onSave();
        system.assert(ApexPages.getMessages().size()>0);
      
        // add required info and try save again
        for(QuoteLineItem o : oPEE.ShoppingCart){
            o.quantity = 5;
            o.unitprice = 300;
        }
        oPEE.onSave();
      
        // query line items to confirm that the save worked
        QuoteLineItem[] qli2 = [select Id from QuoteLineItem where QuoteId = :qli.QuoteId];
        system.assert(qli2.size()==startCount);
      
        // test on new Opp (no pricebook selected) to make sure redirect is happening
        Quote newQuote = new Quote(Name='New quote', OpportunityId=qli.Quote.OpportunityId);
        insert(newQuote);
        oPEE = new QuoteItemExtension(new ApexPages.StandardController(newQuote));
        System.assert(oPEE.priceBookCheck()!=null);
      
        // final quick check of cancel button
        System.assert(oPEE.onCancel()!=null);
      
      
        ////////////////////////////////////////
        //  test redirect page
        ////////////////////////////////////////
      
        // load the page

   
    }
}

We have been using Salesforce Quotes for over six months now and today when I logged in to generate a quote, the images in the text/image field are no longer showing up.  We see the following broken image icons.  I have checked the image (uploaded in documents) and the externally available setting is still checked.  Literally nothing was changed, and the images are no longer working.  Any ideas would be appreciated it!

 

Quote template preview

 

Image settings