• azzani
  • NEWBIE
  • 0 Points
  • Member since 2007

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

I am overriding the "Add Product" button and I am constructing the "Product Selection table". To do that I used the markup and custom controller getter and setter below. I also created a class that represent a PricebookEntry record along with a checkbox element. The getter works fine but my setter is never called when the user click the "select" button. I need the setter to parse returned result to know which Products were selected and update the class List for selected Price book entries. This is very time critical issue so I will really appreciate prompt help.

Thanks,

Aref

Code:
<apex:form >  
  <apex:outputPanel id="ProductsTable">    
   <apex:pageblock > 
    <apex:pageBlockButtons >
     <apex:commandButton action="{!selectProducts}" value="Select"/>
     <apex:commandButton action="{!cancelSelection}" value="Cancel"/>
    </apex:pageBlockButtons>       
    <apex:pageBlockTable value="{!pricebookEntries}" var="pricebookEntry" >       
     <apex:column >    
      <apex:facet name="header"></apex:facet>                 
           <apex:inputCheckbox value="{!pricebookEntry.pbeIsSelected}"/> 
          </apex:column>
        <apex:column >
           <apex:facet name="header">{!$ObjectType.Product2.fields.name.label}</apex:facet>  
           <a href="/{!pricebookEntry.pbeProduct2Id}">       
            {!pricebookEntry.pbeName}
           </a>           
         </apex:column>
         <apex:column >
           <apex:facet name="header">{!$ObjectType.pricebookEntry.fields.ProductCode.label}</apex:facet>          
           <apex:outputText value="{!pricebookEntry.pbeProductCode}"/>           
         </apex:column>
         <apex:column >
           <apex:facet name="header">{!$ObjectType.pricebookEntry.fields.UnitPrice.label}</apex:facet>          
           <apex:outputText value="{!pricebookEntry.pbeUnitPrice}"/>           
         </apex:column>
         <apex:column >
           <apex:facet name="header">{!$ObjectType.Product2.fields.Description.label}</apex:facet>          
           <apex:outputText value="{!pricebookEntry.pbeProductDescription}"/>           
         </apex:column>               
      </apex:pageBlockTable>           
     </apex:pageblock> 
    </apex:outputPanel>      
 </apex:form>  

 and thid controller getter and setter:

Code:
 //-----------------------------------------
 //OverrideAddProduct Page
 //Accessor Methods for <apex:pageBlockTable value="{!pricebookEntries}" var="pricebookEntry" > control
    
    public List<PricebookEntryUIElement> getPricebookEntries() 
    {   
     List<PricebookEntryUIElement> pricebookEntryUIElements = new List<PricebookEntryUIElement>();
       
        List<PricebookEntry> pricebookEntries = [Select Id, IsActive, Name, Pricebook2Id, Product2Id, 
Product2.Description, Product2.Family, ProductCode, UnitPrice
from PricebookEntry where IsActive = true and Product2.Family = :productFamily]; for(PricebookEntry pricebookEntry: pricebookEntries){ PricebookEntryUIElement pricebookEntryUIElement = new PricebookEntryUIElement(); pricebookEntryUIElement.setPbeIsSelected(false); pricebookEntryUIElement.setPbeId(pricebookEntry.Id); pricebookEntryUIElement.setPbeName(pricebookEntry.Name); pricebookEntryUIElement.setPbePricebook2Id(pricebookEntry.Pricebook2Id); pricebookEntryUIElement.setPbeProduct2Id(pricebookEntry.Product2Id); pricebookEntryUIElement.setPbeProductDescription(pricebookEntry.Product2.Description); pricebookEntryUIElement.setPbeProductFamily(pricebookEntry.Product2.Family); pricebookEntryUIElement.setPbeProductCode(pricebookEntry.ProductCode); pricebookEntryUIElement.setPbeUnitPrice(pricebookEntry.UnitPrice); pricebookEntryUIElements.add(pricebookEntryUIElement); } return pricebookEntryUIElements; } public void setPricebookEntries(List<PricebookEntryUIElement> pricebookEntryUIElements) { System.debug('setPricebookEntries visited'); this.selectedPricebookEntries = new List<PricebookEntryUIElement>(); for(PricebookEntryUIElement pricebookEntryUIElement:pricebookEntryUIElements){ if(pricebookEntryUIElement.getPbeIsSelected()){ this.selectedPricebookEntries.add(pricebookEntryUIElement); } } }

 




Message Edited by azzani on 07-08-2008 01:52 AM

Message Edited by azzani on 07-08-2008 01:55 AM
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="ProgId" content="Word.Document"><meta name="Generator" content="Microsoft Word 12"><meta name="Originator" content="Microsoft Word 12">

Hi,

 

I am overriding the "Add Product" button with a VF Page. What will be the easiest way to determine which Products were selected. I know that one option is to trace all  <apex:inputCheckbox> tags using ids and retrieve values (record id) of these checked using a JS script but I am wondering if there is an easier way to implement that using a VF component. I thought of using selectCheckbox but the problem is that it only associate a value and a label.

 

Any help will be appreciated.

 

Thanks,

 

Aref

I'm wanting to display the Opportunity Products related list in a different order and am having trouble coming up with a way to do it.  I'd like everything defined for the relatedlist in the pagelayout to stay the same (header buttons, columns, etc.) so that other uses can still control those pieces through the page layout editor.
 
I thought I might be able to use a relatedList tag and then give it a list of records but it only accepts a parent record that it can pull a related list from.
 
Right now I'm thinking I could extend the Opportunity standardController and then override the method it uses to get the related list but I'm don't know where to find a list of the methods every object can call.  I'd like to override its method so I can call its normal method and then reorder the list of records it returns.
 
Is what I'm trying to do possible?  Does it work like this?  Any other ideas?
I have setup email to case on my server I have also successfully configured the large attachment processing. The problem that I have is  with the attachments they are not case attachments they are attachments to the email that created the case and can only show up under the related lists on the case.
 
Is there a way to do any of the following.
 
1. Modify email-to-case code to make the email attachments case attachment?
 
2. Have the email-to-case app put the link from the large attachment processing in the case body?
 
The reason I need to do this is it takes almost 5 clicks of the mouse to finally get to the attachment and all of our cases will have attachments and this makes the process to difficult for support people
 
Anyone Please Help!
 
Thanks,