• Andrew Muzychuk
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 2
    Likes Given
  • 0
    Questions
  • 1
    Replies

Hi,

 

Please have a look at this code:-

 

 <apex:panelGrid id="selectAdd">                                   
                                       
            <apex:selectList id="fld1" value="{!selectedVal}" multiselect="false" size="1" >                                            

              <apex:selectOptions id="selectAddOption" value="{!addressOptions}"/>      
                     <apex:actionSupport event="onselect" action="{!pickListProcess} rerender="errorPanel,     

                          addressPanel" status="SearchStatus immediate="true"/>                                                     
            

            </apex:selectList>                    
  </apex:panelGrid>  

 

 I am trying to obtain the value of selected picklist option (selectedVal ) in controller method - pickListProcess. But i always get it as null... anyother way to achieve this?

 

Thanks in anticipation...

 

I'm writing a unit test on the opportunity and opportunity line item.  I am getting the error "No standard price is defined".

 

Here is my test method:

 

public static testMethod void test3() 
    { 
    	Pricebook2 pb = new Pricebook2(Name = 'Standard Price Book 2009', Description = 'Price Book 2009 Products', IsActive = true);
    	insert pb;
    	Product2 prod = new Product2(Name = 'Anti-infectives 2007', Family = 'Best Practices', Practice__c = 'GP/BP', Service_Level__c = 'Partial Service', Product_Abbrev__c = 'CMR_Antiinfect', Sales_Unit__c = 'Each', Standard_Unit__c = 'Each', Product_Year__c = '07', Item_Type__c = 'Non-Inventory (Sales only)', IsActive = true);
    	insert prod;
    	PricebookEntry pbe = new PricebookEntry(Pricebook2Id = pb.Id, Product2Id = prod.Id, UnitPrice = 10000, IsActive = true, UseStandardPrice = false);
    	insert pbe;
    	Opportunity opp = new Opportunity(Name = 'Test Syndicated 2010', Type = 'Syndicated - New', StageName = 'Planning', CloseDate = system.today());
    	insert opp;
    	OpportunityLineItem oli = new OpportunityLineItem(opportunityId = opp.Id, pricebookentryId = pbe.Id, Quantity = 1, UnitPrice = 7500, Description = '2007 CMR #4 - Anti-Infectives');
    	insert oli;
		List<OpportunityLineItem> olis = [Select Id From OpportunityLineItem Where OpportunityId =: opp.Id];
		update olis[0];
    }

 

The error is thrown on the line where I try and insert the PricebookEntry record:

 

PricebookEntry pbe = new PricebookEntry(Pricebook2Id = pb.Id, Product2Id = prod.Id, UnitPrice = 10000, IsActive = true, UseStandardPrice = false);
    	insert pbe;

 

I'm not sure what I'm missing. 

 

Thanks for any help.

Regards.

 

Hello,

 

I have checked the boards and tried the samples, but for some reason when I used this bit of code to format my currency:

 

         <apex:outputText value="Rs{0,number, $###,##0.00}">
             <apex:param value="${!opp.Total_Referrals__c}"/>
         </apex:outputText>

 

I get this error:

 

Error: The value attribute on <apex:outputText> is not in a valid format. It must be a positive number, and of type Number, Date, Time, or Choice.

 

I'm clueless in what to do. I merely wish for a basic currency formatting technique. If you can offer any advice, I'd be appreciative.

  • October 18, 2010
  • Like
  • 1