• nlsnyder
  • NEWBIE
  • 25 Points
  • Member since 2012

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

Uploaded email template to salesforce via communication templates.

 

How do I put that template under quotes so I can choose it as a template?

I am a system administrator and I need to know how to change the security settings in my sandbox so that I can generate Quote PDF files.

 

Currently when I click the Create PDF button for a quote, I get the following error:

 

Data Not Available You do not have Edit access to one of the two records you are trying to merge. Please contact your administrator to get additional access or merge the two record.

 

I can do this in production.   How can you what records or fields you do not have access to?

I added an error validation on my custom field End Date when End Date is greater than Begin Date on Quote Line Item to show on the field.

This works great in the Salesforce pages.    I have a custom apex:page that has a dataTable with that column that shows the quantity field.

It correctly shows the error on the field for a brief second but it goes away when the page is rerendered.    

 

I have a try / catch in the custom controller on quote line item update.   But how do I get the error to STAY showing in the data field?

 

Here is the trigger code:

trigger UpdateQuoteLineItemTrigger on QuoteLineItem (before insert, before update) {
    System.Debug('>> In UpdateQuoteLineItemTrigger <<');
    
    for (QuoteLineItem li : trigger.new) {
        
        QuoteLineItem qli = [SELECT id, ListPrice FROM QuoteLineItem WHERE id =: li.id];
        
        Decimal listPrice = li.ListPrice;
        if (li.ListPrice == null) {
            System.Debug('>> LIST PRICE IS NULL ?? <<');
            listPrice = qli.ListPrice;
            System.Debug('>> qli.ListPrice = '+ qli.ListPrice + ' <<');
        }
        
        // Assume List Price is yearly so divide by 12 to get monthly price
        Decimal mprice = (ListPrice / 12);
        li.Monthly_Price__c = mprice.SetScale(2); 
        
        li.Description = li.ProductName__c;
        li.Preview__c = 'Description: '+li.ProductName__c;
        System.Debug('>> preview = '+li.Preview__c + ' <<');
        
        if (li.Prorate__c) {
            System.Debug('>> PRORATE <<');
            date begDate = li.BeginDate__c;
            date endDate = li.EndDate__c;
            System.Debug('>> begDate = '+ begDate + ' endDate = ' + endDate + ' <<'); 
           
            integer m = begDate.monthsBetween(endDate);
            date d3 = begDate.addMonths(m);
            integer d = d3.daysBetween(endDate);
            d = d + 1; // increment the current day
            
            if (d < 0) {
                m = m - 1;
                d3 = begDate.addMonths(m);
                d = d3.daysBetween(endDate);
            }
            System.Debug('>>> m='+ m +' d3='+ d3 + ' d='+d+' <<<');
            
            double prorated_period = m;
            if ((d >= 1) && (d <= 15)) {
                prorated_period = m + 0.5;
            }
            else if (d > 15) {
                prorated_period = m + 1;
            }
            if (m == 0) {
                prorated_period = 0.5;
            }
            System.Debug('>>> prorated_period=' + prorated_period + ' <<<');
            
            // Update prorated period
            li.Period__c = prorated_period;        

            // Prorate the unit price 
            Decimal uprice = (li.Monthly_Price__c * prorated_period);  
            li.UnitPrice = uprice.SetScale(2);    
            
            li.Preview__c += ' (' + begDate.month() + '/' + begDate.day() + '/' + begDate.year() + ' - ' + endDate.month() + '/' + endDate.day() + '/' + endDate.year() + '; '+ li.period__c + ' months)';           
        }
        else if (li.Renew__c) {
            System.Debug('>> RENEW <<');
            li.UnitPrice = ListPrice;
           
            System.Debug('>> li.years__c='+li.years__c+' BegDt='+li.BeginDate__c+' EndDt='+li.EndDate__c+' <<');
            if (li.years__c == null) {
               li.years__c = '1';
            }
            integer years = integer.valueOf(li.years__c);
            li.quantity = li.quantity;
            li.period__c = 12 * years;
            
            if (li.BeginDate__c == null) {
                li.BeginDate__c = Date.today();
            }
            date begDate = li.BeginDate__c;
            date newEndDt = begDate.addMonths(years * 12) - 1;
            li.EndDate__c = newEndDt;    
            
            li.Preview__c += ' (' + begDate.month() + '/' + begDate.day() + '/' + begDate.year() + ' - ' + li.EndDate__c.month() + '/' + li.EndDate__c.day() + '/' + li.EndDate__c.year() + ')';      
        }
        else {
            System.Debug('>> NOT PRORATE && NOT RENEW <<');
            li.UnitPrice = ListPrice;
            li.period__c = 0;  // doesn't apply so giving it a zero 
        }
        
        System.Debug('>** ProductName='+ li.ProductName__c + 'quantity=' + li.quantity + ' ListPrice=' + li.ListPrice + ' UnitPrice=' + li.UnitPrice +  ' Renew='+li.renew__c + ' prorate='+li.prorate__c +' Period='+li.period__c + ' desc=' + li.description + ' period='+ li.period__c + ' <<<'); 
    }
}

 I know that ListPrice is a readonly value but I thought it would already be set?   How do I fix this?

I have done the workaround for the sort line items.   The lines are sorted via a custom web service so there is no need to pop up the /oppitm/lineitemsort.jsp page.    I create the form and hidden fields dynamically and hit submit.   This pops up the jsp page.   I want to skip that and auto submit via ajax or something.    It works when I have form.submit() and the form pops up and I click the Save button.   Is there a way to replace the form.submit() and having the user click the save button.

 

I tried to use jquery ajax and ajaxSubmit, but I get an error with the error message so not sure what is wrong.   Can this be done and does anyone know how to do that part.

 

--------------------------------------------------------------------------------------------

 

So I had this originally:

{!REQUIRESCRIPT("/soap/ajax/22.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/22.0/apex.js")}

var quoteID = '{!Quote.Id}';

//call the apex web service to get the QLIs in the desired sort order for this opp
//var result = sforce.apex.execute("customSort","MRsort",{quoteID:quoteID});   
var result = sforce.apex.execute("customSort","QLI_SortByPrdQty",{quoteID:quoteID});   

//need to post a form to /oppitm/lineitemsort.jsp because this is how SFDC
//does it but there is not direct API to do the sorting (thus the awkward workaround)
var form = document.createElement("form");
form.setAttribute("method", "post");
form.setAttribute("action", "/oppitm/lineitemsort.jsp");

form.setAttribute("id", "sortForm");

//set the id of the request to the quote ID
var hiddenField = document.createElement("input");
hiddenField.setAttribute("type", 'hidden');
hiddenField.setAttribute("name", 'id');
hiddenField.setAttribute("value", '{!Quote.Id}');   
form.appendChild(hiddenField);

//the name of the sorted OLI list that the JSP is expecting is "duel0"
var hiddenField = document.createElement("input");
hiddenField.setAttribute("type", 'hidden');
hiddenField.setAttribute("name", 'duel0');
hiddenField.setAttribute("value", String(result));
form.appendChild(hiddenField);

var hiddenField = document.createElement("input");
hiddenField.setAttribute("type", 'hidden');
hiddenField.setAttribute("name", 'retURL');
hiddenField.setAttribute("value", '/{!Quote.Id}');
form.appendChild(hiddenField);

//set to save
var hiddenField = document.createElement("input");
hiddenField.setAttribute("type", 'hidden');
hiddenField.setAttribute("name", 'save');
hiddenField.setAttribute("value", ' Save ');
form.appendChild(hiddenField);

//need to do this so it works in IE
document.body.appendChild(form);

//submit!!
form.submit();

 

I have been commenting out the form.submit and trying to use jquery / ajax to automate:

 

I include the jquery js scripts:

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.js"></script>
    <script src="http://malsup.github.com/jquery.form.js"></script>

 

I tried using $.ajax where formData is the form data serialized but get the error alert with error=error. 

 

         $.ajax({
             type: "post",
             url:  "https://na14.salesforce.com/oppitm/lineitemsort.jsp",
             data: formData,
             success: function() {
                 alert('>> ajax submit successful <<');
             },
             error: function(req, status, error) {
                 alert('>> ajax submit failed: status='+ status + ' error=' + error + ' <<');
             }
         });
        

Then tried and get the error alert with error=error again.
         
         $('#sortForm').ajaxSubmit({
             success: function() {
                 alert('>> ajax submit successful <<');
             },
             error: function(req, status, error) {
                 alert('>> ajax submit failed: req='+req+' status='+ status + ' error=' + error + ' <<');
             }
         });

 

I am trying to use apex:actionFunction that has one parameter in my apex:page javascript but the parameter is always null and I cannot figure out WHY?

 

I created a simple test page to test what I am doing:

--------------------------------------------------------------------------

<apex:page standardController="Quote" extensions="QuoteLineItems_ControllerExtension">

<apex:pagemessages />
<apex:pageBlock mode="edit">
    <apex:form id="testPage_Form">
        <script language="JavaScript" type="text/javascript">  
            function test1() {
                alert('>> init TEST_PAGE <<');   
                updateTest('this is my test data');
            }
        </script>
        
        <apex:actionFunction name="updateTest" action="{!updateTestData}">
           <apex:param name="test_param1" value="TEST_DUMMY" />
        </apex:actionFunction>
        
        <input type='button' value='TEST 1' onclick='test1();'/>
    </apex:form>
</apex:pageBlock>
</apex:page>

 

Here is a method in my the controller:

--------------------------------------------------

    public PageReference updateTestData() {
        System.Debug('>>> updateTest <<<');
        String test_param1 = ApexPages.CurrentPage().getParameters().get('test_param1');
        System.Debug('>>> test_param1 = '+ test_param1 + ' <<<');
        return null;
    }

 

Debug Log returns:

    >>> updateTest <<<

    >>> test_param1 = null <<<         ?? WHY NULL, expecting 'this is my test data'

 

WHAT am I doing wrong?

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>

 

 

 

 

 

Should I create a trigger for opportunity for update or use a workflow rule on opportunity?   Which is better and why?

 

 

 

 

I created a new custom apex page.  Now I am trying to create a custom button on Quote Line Item to bring up this new page.    I select List Button as Display Type and Content Source as  VisualForce Page.   But the Content drop down list where you are suppose to select the page is empty.

 

I have gone back to the custom page and clicked the Security link and have selected "Standard Platform User", "Standard User", "System Administrator" but no pages show up.  Which profiles need to be enabled to have the button bring up a page for the Quote or Quote Line Items?   Then I enabled all the profiles for the Security and still no pages show up in my content list drop down.  

 

So how can I attach a custom button to a apex page that I create if the list is always empty??

 

I have a apex page that contains two forms (each contains a pageBlock).  The top form contains a table of quote line items with 4 command buttons.  I am trying to get the 4th button "Edit Selected Lines" to show the bottom form's pageBlock but I cannot get it to work.

I want the "Edit Selected Lines" button to SHOW the bottom pageBlock "editForm" when clicked.  Then when you click "Save" or "Cancel" on the bottom form, the bottom pageBlock "editBlock" is hidden.  WHAT am I doing wrong??  I have googled and seen examples that do similar things but my does not work?  I originally had one form with two pageBlocks but that didn't work either.  

TO ME:  The "Edit Selected Lines"
   <apex:commandButton action="{!enableEditMode}" value="Edit Selected Lines" rerender="editBlock"/>
shoud call my controller and set editMode to true (and it does), then afterwards it should rerended the edit block.  The editBlock should show up because the rendered flag is set to "{!editMode}" which is now true.  WHY does it not show up?

I have the following Controller which contains editMode:
----------------------------------------------------------------
public class QuoteLineItems_ControllerExtension {
    
    private final Quote quote;   
    private list<QuoteLineItem> quoteLineItems;
    private final ApexPages.StandardController stdController;
    private QuoteLineItem editLineItem;
    private boolean editMode;
    
    public QuoteLineItems_ControllerExtension (ApexPages.StandardController stdController) {
        this.quote = (Quote)stdController.getRecord();    
        this.quoteLineItems = this.quote.QuoteLineItems;     
        this.stdController = stdController;
        this.editLineItem = new QuoteLineItem();
        this.editMode = false;
    }
    
    public Quote getQuote() {
        return quote;
    }
    public boolean getEditMode() {
        return editMode;
    }
    public void setEditMode(boolean editMode) {
        this.editMode = editMode;
    }
    public QuoteLineItem getEditLineItem() {
        return editLineItem;
    }
    public void setEditLineItem(QuoteLineItem editLineItem) {
        this.editLineItem = editLineItem;
    }
    public void enableEditMode() {
        editMode = true;
    }
    public void disableEditMode() {
        editMode = false;
    }
    public list<QuoteLineItem> getQuoteLineItems() {
        return quoteLineItems;
    }
    public void setQuoteLineItems(list<QuoteLineItem> quoteLineItems) {
        this.quoteLineItems = quoteLineItems;
    }
.....
}

I have the following apex page.   I originally had one form with two page blocks, then switched to two forms but neither worked?
--------------------------------------------------------------------------------------------------------------------------------
<apex:page standardController="Quote" extensions="QuoteLineItems_ControllerExtension" sidebar="false">

  <apex:variable var="editLineItem" value="{!editLineItem}"/>
  <apex:variable var="editMode"     value="{!editMode}"/>
 
  <apex:messages id="messages"/>
   
  <apex:form id="EditAllQuoteLine_Form">
    <style>
       .ct { text-align: center; }
    </style>
 
    <apex:actionFunction name="showEditBlock" action="{!enableEditMode}"  rerender="editBlock"/>
    <apex:actionFunction name="hideEditBlock" action="{!disableEditMode}" rerender="editBlock"/>
 
    <script language="JavaScript" type="text/javascript">
....         
     function editSelectedLines() {
         //alert('In editSelectedLines');         
         showEditBlock();  
     }  
     function saveEdit() {
         //alert('In saveEdit');
     }
     function cancelEdit() {
         hideEditBlock;
     }
    </script>
 
    <apex:pageBlock title="Edit Quote Line Items for {!Quote.Name}" mode="edit">
        <apex:actionFunction name="updateData" action="{!updateLineData}" rerender="LineItemTable,messages" oncomplete="init();">
            <apex:param name="param1" value=""/>
        </apex:actionFunction>
         
        <apex:pageBlockButtons >
            <apex:commandButton action="{!saveQuoteLineItems}"   value="Save All Line Items"/>
            <apex:commandButton action="{!updateQuoteLineItems}" oncomplete="init()" value="Update All Line Items" rerender="LineItemTable,messages"/>
            <apex:commandButton action="{!cancel}" value="Cancel"/>
            <apex:commandButton action="{!enableEditMode}" value="Edit Selected Lines" rerender="editBlock"/>
        </apex:pageBlockButtons>
        
        <apex:dataTable id="LineItemTable" value="{!Quote.QuoteLineItems}" var="lines" rowClasses="odd,even"
                        styleClass="tableClass" cellpadding="4"  border="1" headerClass="ct">            
                       
            <apex:column headerValue="Edit">
                <apex:inputField id="multiEdit_field" value="{!lines.MultiEdit__c}"/>
            </apex:column>                    
            <apex:column headerValue=" Quantity ">
                 <apex:inputField id="qty_field" value="{!lines.Quantity}" style="width: 50px;" onchange="var lpos=getLinePos(this.id); updateData(lpos);">
                 </apex:inputField>
            </apex:column>
            <apex:column headerValue="Product">
                 <apex:inputField id="product_field" value="{!lines.ProductName__c}" style="width: 150px;"/>
            </apex:column>            
            <apex:column headerValue="List Price">
                 <apex:inputField id="listPrice_field" value="{!lines.ListPrice}"/>
            </apex:column>     
            <apex:column headerValue="Sales Price" style="width: 70px;">
                 <apex:inputField id="salesPrice_field" value="{!lines.UnitPrice}" style="width: 50px;"/>
            </apex:column>  
            <apex:column headerValue="Renew?">
                 <apex:inputCheckbox id="renew_field" value="{!lines.Renew__c}" onclick="var lpos=getLinePos(this.id); updateData(lpos);"/>
            </apex:column>
            <apex:column headerValue="Prorate?">
                 <apex:inputCheckbox id="prorate_field" value="{!lines.Prorate__c}" onclick="var lpos=getLinePos(this.id); updateData(lpos);" />
            </apex:column>
            <apex:column headerValue="Years?">
                 <apex:inputField id="years_field" value="{!lines.Years__c}" onchange="var lpos=getLinePos(this.id); updateData(lpos);" rendered="{!lines.Prorate__c == false}"/>
            </apex:column>
            <apex:column headerValue="Begin Date">
                <apex:inputField id="begDt_field" value="{!lines.BeginDate__c}"  onchange="var lpos=getLinePos(this.id); updateData(lpos);"/>
            </apex:column>
            <apex:column headerValue="End Date">
                <apex:inputField id="endDt_field" value="{!lines.EndDate__c}" onchange="endDateChanged(this);"/>             
            </apex:column>
            <apex:column headerValue="Period">
                 <apex:outputField id="period_field" value="{!lines.Period__c}" style="width: 75px;" rendered="{!lines.Period__c > 0}"/>
            </apex:column>
            <apex:column headerValue="MonthlyPrice">
                <apex:outputField id="monthlyPrice_field" value="{!lines.Monthly_Price__c}" rendered="{!lines.Prorate__c}"/>
            </apex:column>    
            <apex:column headerValue="Subtotal">
                <apex:outputField id="subtotal_field" value="{!lines.updatedSubtotal__c} "/>
            </apex:column>                                                                                     
        </apex:dataTable>      
    </apex:pageBlock>
  </apex:form>   
 
  <apex:form id="EditSelectedLines_Form">
    <apex:pageBlock title="Edit Common Fields for Selected Lines" id="editBlock" rendered="{!editMode}">
        <apex:dataTable id="editTable" value="{!EditLineItem}" var="editLine"
                        styleClass="tableClass" cellpadding="4"  border="1" headerClass="ct">
            <apex:column headerValue="Renew?">
                 <apex:inputCheckbox id="renew_edit" value="{!editLine.Renew__c}"/>
            </apex:column>
            <apex:column headerValue="Prorate?">
                 <apex:inputCheckbox id="prorate_edit" value="{!editLine.Prorate__c}"/>
            </apex:column>
            <apex:column headerValue="Years?">
                 <apex:inputField id="years_edit" value="{!editLine.Years__c}"/>
            </apex:column>
            <apex:column headerValue="Begin Date">
                <apex:inputField id="begDt_edit" value="{!editLine.BeginDate__c}"/>
            </apex:column>
            <apex:column headerValue="End Date">
                <apex:inputField id="endDt_eidt" value="{!editLine.EndDate__c}"/>             
            </apex:column>                 
        </apex:dataTable>
        
        <table width='500'><tr><td align='center'>
            <apex:commandButton action="{!disableEditMode}" value="Save"   rerender="editBlock"/>
            <apex:commandButton action="{!disableEditMode}" value="Cancel" rerender="editBlock"/>
        </td></tr></table>    
     </apex:pageBlock>   
  </apex:form>
 
</apex:page>

I see there is a sort button on the QuoteLineItems.  By default it is for the product name.

I also see on the Quote Layout Page that you can check which buttons show up (Add Line Item, Edit All, Sort).

 

But can I customize the sort.   We want to sort on 2 fields.  

 

I see another post on this forum for changing the Quote Line Item sort order (https://na9.salesforce.com/p/setup/link/CustomResourceLinkList?pageName=Opportunity&type=Opportunity&setupid=OpportunityLinks&retURL=%2Fui%2Fsetup%2FSetup%3Fsetupid%3DOpportunity)

 

It shows adding a global webservice MRsort.    This references OpportunityLineItem and to change the Opportunity_Line_Item__c to Quote_Item_Number__c.   So this sounds like I need to add a custom field to OpportunityLineItem.   But I don't see that object in salesforce?   I have Quotes and QuoteLineItems.   I have Opportunities and OpportunityProducts.    I can add the webservice but I need to reference OpportunityLineItems?

 

How do you get access to OpportunityLineItem to add a custom field?  Our system admin does not know and said that I was an admin too.   Is there some security access that I need to set to see this?

I have a apex page with a dataTable that contains a date field as a apex:inputField.

Is there anyway to show the date textbox (that popups the calendar) without the date link?

I have a apex:dataTable in my apex:page that works great.   I would like to center all of the column headers and some of the data values in the rows. 

 

I tried the following:

   1)  added style="text-align:center;" to the <apex:dataTable tag.   This centers the data rows (or values) but not the column headers.

   2)  added style="text-align:center;" to the apex header like this <apex:column headerValue="Product" style="text-align:center;"> but still does not center header.

  

Thanks in advance :)

I have the following code below and can get the line items for a quote and display in a table for editing.   But I can't figure out how I can save them.

The current save button only saves the Quote.  I want to save the edited quote line items when save is clicked.  How can I do that?

 

<apex:page standardController="Quote"> 

 
  <apex:form id="EditAllQuoteLine_Form">
 
    <apex:pageBlock title="Edit Quote Line Items for {!Quote.Name}" mode="edit">
        <apex:pageBlockButtons >
            <apex:commandButton action="{!save}"   value="Save"/>
            <apex:commandButton action="{!cancel}" value="Cancel"/>
        </apex:pageBlockButtons>
  
        <apex:dataTable value="{!Quote.QuoteLineItems}" var="lines" id="theTable" rowClasses="odd,even"
                        styleClass="tableClass" cellpadding="3" cellspacing="3">      
            <apex:column headerValue=" Quantity ">
                 <apex:inputField value="{!lines.Quantity}" style="width: 50px;"/>
            </apex:column>
            <apex:column headerValue="  Product  " style="align: center;">
                 <apex:inputField value="{!lines.ProductName__c}" style="width: 150px;"/>
            </apex:column>            
            <apex:column headerValue=" List Price ">
                 <apex:inputField value="{!lines.ListPrice}"/>
            </apex:column>     
            <apex:column headerValue=" Sales Price " style="width: 70px;">
                 <apex:inputField value="{!lines.UnitPrice}" style="width: 50px;"/>
            </apex:column>  
            <apex:column headerValue=" Renew? ">
                 <apex:inputCheckbox value="{!lines.Renew__c}" onclick="renewClicked(this)" />
            </apex:column>
            <apex:column headerValue=" Prorate? ">
                 <apex:inputCheckbox value="{!lines.Prorate__c}" disabled="true"/>
            </apex:column>
            <apex:column headerValue="Begin Date">
                <apex:inputField value="{!lines.BeginDate__c}"  rendered="{!lines.Renew__c}"/>
            </apex:column>
            <apex:column headerValue="End Date">
                <apex:inputField value="{!lines.EndDate__c}" rendered="{!lines.Prorate__c}"/>             
            </apex:column>
            <apex:column headerValue=" Period ">
                 <apex:outputField value="{!lines.Period__c}"/>
            </apex:column>                                           
        </apex:dataTable>
        
    </apex:pageBlock>
  </apex:form>
</apex:page>

When you create a opportunity and select products to add, it then brings up a screen to Add Products to this opportunity from a price book.   Can I customize this Add Products to this opportunity display.   If so, how do you get to this screen to change the code.

I need to add some customization to the quote / quote line items.   We need the ability to be able to prorate some line items where each line item can have a different begin and end date.  So I was thinking about adding some custom fields (checkbox for prorate and two dates: begin and end date) to the quote line item and a custom button to the quote called "Adjust Line Items" and a trigger on the Quote.

 

So Is it possible to create a custom button on the Quote that would bring up a custom display that would show all the quote line item fields where the user could edit the necessary fields.   For example, the user could check prorate and enter a begin and end date for the line items that needed it.  Also it is possible to add a trigger where when the fields change (like prorate checked and there is a begin and end date) update the line item price and total.   Also, is it possible to add a save and cancel button to this custom page that would trigger on save to update the quote.

 

If this is possible, do I create a custom object that represents this and that object has a page layout?

 

Just learning and have alot of ideas on what I should do but not sure if they are all possible.

I have a trigger on Quote to prorate line items.   But I need to access attributes from the Product for the QuoteLineItem which is defined as Field Product2 and Type Lookup(Product).  How can I get the ProductCode, Description and Name of the QuoteLineItem's Product?

I need to have products that have a prorated value for maintenance.   For example, normally the maintenance is for a year (12 months).   But if you only need it for 6 months or 8.5 months I need to adjust the price value on the product.  I would like to add custom fields (prorated checkbox, begin date, end date) to calcalute the range and then adjust the price value.   Any suggestions on where to apply this customization so I can change the price value if prorated,   I tried the opportunity and quote but can't seem to get what I want.

I am a system administrator and I need to know how to change the security settings in my sandbox so that I can generate Quote PDF files.

 

Currently when I click the Create PDF button for a quote, I get the following error:

 

Data Not Available You do not have Edit access to one of the two records you are trying to merge. Please contact your administrator to get additional access or merge the two record.

 

I can do this in production.   How can you what records or fields you do not have access to?

I have a apex page with a dataTable that contains a date field as a apex:inputField.

Is there anyway to show the date textbox (that popups the calendar) without the date link?

I have a trigger on Quote to prorate line items.   But I need to access attributes from the Product for the QuoteLineItem which is defined as Field Product2 and Type Lookup(Product).  How can I get the ProductCode, Description and Name of the QuoteLineItem's Product?