• Lucky_m
  • NEWBIE
  • 0 Points
  • Member since 2013

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

I'm trying to adapt some code from Jeff Douglass that I know works, but my changes break it.  For starters, I get the error "Unknown Constructor 'PricebookEntry.PricebookEntry()'" and I can't even find where this refers to.  Any help appreciated, thank you.

 

  <apex:page controller="PricebookEntry" sidebar="false">
 
  <apex:form >
  <apex:pageMessages id="errors" />
 
  <apex:pageBlock title="Find A Product" mode="edit">
 
  <table width="100%" border="0">
  <tr>  
    <td width="200" valign="top">
 
      <apex:pageBlock title="Parameters" mode="edit" id="criteria">
 
      <script type="text/javascript">
      function doSearch() {
        searchServer(
          document.getElementById("product2ID").value,
          document.getElementById("Name").value,
          document.getElementById("description").value,
          document.getElementById("unitprice").value
          );
      }
      </script> 
 
      <apex:actionFunction name="searchServer" action="{!runSearch}" rerender="results,debug,errors">
          <apex:param name="Product2ID" value="" />
          <apex:param name="Name" value="" />
          <apex:param name="description" value="" />
          <apex:param name="unitprice" value="" />
      </apex:actionFunction>
 
      <table cellpadding="2" cellspacing="2">
      <tr>
        <td style="font-weight:bold;">Name<br/>
        <input type="text" id="Name" onkeyup="doSearch();"/>
        </td>
      </tr>
      <tr>
        <td style="font-weight:bold;">Description<br/>
        <input type="text" id="description" onkeyup="doSearch();"/>
        </td>
      </tr>
          <tr>
          <td style="font-weight:bold;">product2ID<br/>
          <input type="text" id="Product2ID" onkeyup="doSearch();"/>
          </td>
          </tr>
         
      </table>
 
      </apex:pageBlock>
 
    </td>
    <td valign="top">
 
    <apex:pageBlock mode="edit" id="results">
 
        <apex:pageBlockTable value="{!name}" var="product">
 
            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Name" action="{!toggleSort}" rerender="results,debug">
                        <apex:param name="sortField" value="Name" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!Name}"/>
            </apex:column>
 
            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Description" action="{!toggleSort}" rerender="results,debug">
                        <apex:param name="sortField" value="Description" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!Description}"/>
            </apex:column>
 
            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Product2ID" action="{!toggleSort}" rerender="results,debug">
                    // <apex:param name="sortField" value="pricebookentry.name" assignTo="{!sortField}"/>
                    // </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!product2id}"/>
            </apex:column>
 
            //<apex:column >
            //  <apex:facet name="header">
            //        <apex:commandLink value="Technologies" action="{!toggleSort}" rerender="results,debug">
            //            <apex:param name="sortField" value="interested_technologies__c" assignTo="{!sortField}"/>
            //        </apex:commandLink>
            //    </apex:facet>
            //     <apex:outputField value="{!contact.Interested_Technologies__c}"/>
            // </apex:column>
 
        </apex:pageBlockTable>
 
    </apex:pageBlock>
 
    </td>
  </tr>
  </table>
 
  <apex:pageBlock title="Debug - SOQL" id="debug">
      <apex:outputText value="{!debugSoql}" />           
  </apex:pageBlock>    
 
  </apex:pageBlock>
 
  </apex:form>
 
</apex:page>