+ Start a Discussion
nlsnydernlsnyder 

URGENT need help getting custom sort on multiple fields to work - almost there

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" />
    <tr>
        <td>
            <div class="duelingListBox" id="duel">
                <div class="errorMsg" id="editPage_duel_errorMsg" style="display:none">&nbsp;</div>          
                <table class="layout">
                    <tr>
                        <td class="selectCell">
                            <div class="selectTitle">
                                <label for="duel_select_0">Products</label>
                            </div>
                            <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}"/>
                                        </apex:outputText>                                                                      
                                    </option>
                                </apex:repeat>
                            </select>
                        </td>
                        <td class="buttonCell">
                            <div class="text">Top</div>
                            <div class="text">
                                <ahref="javascript&colon;window.editPage_DLBEInstance.instMoveTop(document.editPage.duel_select_0,'editPage_duel_errorMsg');">
                                    <img src="/s.gif" alt="Top"  class="doubleArrowUp" title="Top"/>
                                </a>
                            </div>
                            <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>
                            <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>
                            <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>
                            <div class="text">Bottom</div>
                        </td>
                    </tr>
                </table>
            
                <script  type="text/javascript">window.editPage_DLBEInstance=new DuelingListBoxesElement(['duel_select_0'],'editPage_duel_errorMsg');
                </script>
            </div>
        </td>
    </tr>
    <tr>
        <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"/>
        </td>
    </tr>
</form>
</table>
</apex:pageBlock>

</apex:page>

 

 

 

 

 

craigvb5craigvb5

Have you found the answer to this?  I am struggling with the same issue

gonzalolgonzalol
Has anyone figured this out?
Robert van GentRobert van Gent
nlsnyder, did you ever found an answer on this post?

This post was giving me a good start of my custom sorting problem and extending lineitmsort.jsp with some custom fields, but indeed the cancel and save buttons point to broken links. I have compared the HTML source of the working lineitemsort.jsp and your VF page and they seems to be the same.