• Robert van Gent
  • 0 Points
  • Member since 2014

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
  • 2

I have spent a few days trying to get the custom sort to work on Quote Line Items on multiple fields.   I googled and searched the forums and found lots of helpful code that got me started.   I created a global class for sorting and have a webservice function that correctly works.   I added the custom javascript button like the forum says and that works.  The problem with this is when the user clicks the sort button, it brings up a screen with the product names in the sorted order.  So if the user clicks save.  It all good.  But the user sees a screen with a list with only product names and not the other fields that are being sorted.  So I created a custom page which almost works.  It shows the sort fields in the list.  The arrows work but the save and cancel button are broken.   

Get this error: Unable to Access Page
You are missing information needed by the page you have attempted to access. If you believe this is an error, please refresh your screen. If the error persists, please report it to our Customer Support team and provide the URL of the page you were requesting as well as any other related information.

Not sure how to debug to find out what fields is missing and if this approach that I am doing will work.  ANY CLUES??

<apex:page standardController="Quote">
<apex:variable var="QuoteName" value="{!Quote.Name}"/>
<apex:variable var="QuoteNumber" value="{!Quote.QuoteNumber}"/>
<apex:variable var="QuoteID" value="{!Quote.ID}"/>

<!-- <apex:pageBlock title="Sort Line Items for Quote {!Quote.Name}" mode="edit"> -->
<apex:pageBlock mode="edit">

<apex:sectionHeader title="Quote" subtitle="{!Quote.Name}"/>

<apex:outputText value="Custom Sort: Use the arrows to sort the products into the desired order."/>

<table cellpadding="0"  cellspacing="0" border='1'>

<form action="/oppitm/lineitemsort.jsp" id="editPage" method="post" name="editPage"
      onsubmit="javascript&colon;saveAllSelected([ document.editPage.duel_select_0 ], [ document.editPage.duel0 ], ',', '\\', '--None--');if (window.ffInAlert) { return false; }" >

<input type="hidden" name="id"     id="id"     value="{!QuoteID}" />
<input type="hidden" name="duel0"  id="duel0"  value="" />
<input type="hidden" name="retURL" id="retURL" value="/{!QuoteID}" />
<input type="hidden" name="save"   id="save"   value=" Save " />

<input type="hidden" name="_CONFIRMATIONTOKEN" id="_CONFIRMATIONTOKEN" value="yQN58ySIY4QOYgFqpKp7921vvbV7VYmaQ5EoYKczxj5dNazdime9nNepdEnPMDabtWtrxQDk38.EWXdTnHtzykYF0rEp4.1AyPH2wH4b2bLTFxF5eYqkkGO5karLiujBR4sYwu.vOvDCJVC.2wHWAmRr.0Y=" />
<input type="hidden" name="cancelURL"    id="cancelURL"    value="/{!QuoteID}" />
<input type="hidden" name="save_new_url" id="save_new_url" value="/oppitm/lineitemsort.jsp" />
            <div class="duelingListBox" id="duel">
                <div class="errorMsg" id="editPage_duel_errorMsg" style="display:none">&nbsp;</div>          
                <table class="layout">
                        <td class="selectCell">
                            <div class="selectTitle">
                                <label for="duel_select_0">Products</label>
                            <select id="duel_select_0" multiple="multiple" name="duel_select_0" size="25">
                                <apex:repeat var="lines" value="{!Quote.QuoteLineItems}">       
                                    <option value="{!lines.Id}">
                                       <!-- <apex:outputText value=" {2}  (Qty={0}   BeginDate={1,date, MM-dd-yyyy}) "> -->
                                       <apex:outputText value=" Qty={0, number, ###,###,###}   BeginDate={1,date, MM-dd-yyyy}   Prd={2}">
                                            <apex:param value="{!lines.Quantity}"/>
                                            <apex:param value="{!lines.BeginDate__c}"/>
                                            <apex:param value="{!lines.ProductName__c}"/>
                        <td class="buttonCell">
                            <div class="text">Top</div>
                            <div class="text">
                                    <img src="/s.gif" alt="Top"  class="doubleArrowUp" title="Top"/>
                            <div class="text">Up</div>
                            <div class="text">
                                <a href="javascript&colon;window.editPage_DLBEInstance.instMoveUp(document.editPage.duel_select_0, null, null, null,'editPage_duel_errorMsg');" id="duel_select_0_up"><img src="/s.gif" alt="Up"  class="upArrowIcon" title="Up"/></a>
                            <div class="text">
                                <a href="javascript&colon;window.editPage_DLBEInstance.instMoveDown(document.editPage.duel_select_0, null, null, null,'editPage_duel_errorMsg');" id="duel_select_0_down"><img src="/s.gif" alt="Down"  class="downArrowIcon" title="Down"/></a>
                            <div class="text">Down</div>
                            <div class="text">
                                <a href="javascript&colon;window.editPage_DLBEInstance.instMoveBottom(document.editPage.duel_select_0,'editPage_duel_errorMsg');"><img src="/s.gif" alt="Bottom"  class="doubleArrowDwn" title="Bottom"/></a>
                            <div class="text">Bottom</div>
                <script  type="text/javascript">window.editPage_DLBEInstance=new DuelingListBoxesElement(['duel_select_0'],'editPage_duel_errorMsg');
        <td align="center">
            <input value=" Save "  class="btn" name="save"   title="Save"   type="submit"/>&nbsp;&nbsp;&nbsp;
            <input value="Cancel"  class="btn" name="cancel" title="Cancel" type="submit"/>









I have a VF page; which I am rendering as a PDF. In the page; I have a table which displays "QuoteLineItems".

I want that the table header should be repeated if the contents of "Table" goes over a page.


After doing research I found out that there is a css property which can be used to achieve this. But when I try to implement the solution it is not working. I have used following code(just a part of HTML)


Css that I have used -


thead { display: table-header-group;}



VF Page Code - 

<table border="0" width="100%" id="table4">
               <th bgcolor="#C0C0C0"><font face="Arial">{!$Label.quotePosition}</font></th>
               <th bgcolor="#C0C0C0"><font face="Arial">{!$Label.quoteDescription}</font></th>
               <!--<td bgcolor="#C0C0C0"><font face="Arial">Image</font></td>-->
               <th bgcolor="#C0C0C0"><font face="Arial">{!$Label.quoteQuantity}</font></th>
               <th bgcolor="#C0C0C0"><font face="Arial">{!$Label.quoteTotalPerPosition}</font></th>
            <apex:repeat value="{!lstQuoteLineItems}" var="quoteLineItemObj"> 
                     <td style="vertical-align:top">{!quoteLineItemObj.Position__c}</td>
                     <td style="vertical-align:top">{!quoteLineItemObj.Description}<br/>
                         <apex:outputField value="{!quoteLineItemObj.Product_Detail__c}"/> 
                     <td style="vertical-align:top"><apex:outputText value="               {!quoteLineItemObj.Quantity}" /></td>
                     <td style="vertical-align:top"><apex:OutputField value=" {!quoteLineItemObj.Total_Per_Position__c}"/></td>


Does anybody implemented this sought of functionality; if yes, could you please share your thought or tell me what I am doing wrong here!!


Thanks in advance!!