You need to sign in to do that
Don't have an account?
jmullins525
Edit Multiple Quote Line Items
I'm trying to build a VF page that will display and allow editing of existing quote line items. So far I have this:
<apex:page standardController="Quote" showHeader="true" sidebar="false" >
<apex:form >
<apex:pageBlock title="Quote Line Items">
<apex:pageBlockTable value="{!Quote.QuoteLineItems}" var="item">
<apex:column value="{! item.part__c}"/>
<apex:inputField value="{!item.Proposed_Direct_Customer_Price__c}"/>
<apex:commandButton action="{!save}" value="Save!"/>
</apex:pageblocktable>
</apex:pageblock>
</apex:form>
</apex:page>
- The save button and proposed direct customer price do not appear on the page but the part__c read only field does appear for each line item. What am I doing wrong?
<apex:page standardController="Quote" showHeader="true" sidebar="false" >
<apex:form >
<apex:pageBlock title="Quote Line Items">
<apex:pageBlockTable value="{!Quote.QuoteLineItems}" var="item">
<apex:column value="{! item.part__c}"/>
<apex:inputField value="{!item.Proposed_Direct_Customer_Price__c}"/>
<apex:commandButton action="{!save}" value="Save!"/>
</apex:pageblocktable>
</apex:pageblock>
</apex:form>
</apex:page>
- The save button and proposed direct customer price do not appear on the page but the part__c read only field does appear for each line item. What am I doing wrong?
<apex:column value="{! item.part__c}">
<apex:inputField value="{!item.Proposed_Direct_Customer_Price__c}"/>
<apex:commandButton action="{!save}" value="Save!"/>
</apex:column>
<apex:page standardController="Quote" showHeader="true" sidebar="false" >
<apex:form >
<apex:pageBlock title="Quote Line Items">
<apex:pageBlockTable value="{!Quote.QuoteLineItems}" var="item">
<apex:column value="{! item.part__c}">
<apex:inputField value="{!item.Proposed_Direct_Customer_Price__c}"/>
<apex:commandButton action="{!save}" value="Save!"/>
</apex:column>
</apex:pageblocktable>
</apex:pageblock>
</apex:form>
</apex:page>
I get the following error: You may specify either a ''value'' attribute or a body for the column component, but not both.
Latest version displays static and dynamic fields but the save button is actually saving to the quote, not the line item. So even though it looks like it's saving it's not.
<apex:page standardController="Quote" showHeader="true" sidebar="false" >
<apex:form >
<apex:pageBlock title="Quote Line Items">
<apex:pageBlocktable value="{!Quote.QuoteLineItems}" var="item">
<apex:column headerValue="Part Number">
<apex:outputField value="{!item.Part__c}" />
</apex:column>
<apex:column headerValue="unit price">
<apex:inputtext value="{!item.UnitPrice}" />
</apex:column>
<apex:column headerValue="quantity">
<apex:inputtext value="{!item.Quantity}" />
</apex:column>
</apex:pageblocktable>
<apex:pageblockbuttons >
<apex:commandButton action="{!save}" value="Save!"/>
</apex:pageblockbuttons>
</apex:pageblock>
</apex:form>
</apex:page>
I wrote a custom controller but I think I need to write the save functionality to the quote line item in the custom controller and I'm not sure how to do that... am I going down the right path?
public class MyQuoteLIController {
public PageReference save() {
return null;
}
public Quote getQuote() {
return [SELECT id, name,
(SELECT Id, Part__c, Quantity, UnitPrice, QuoteId
FROM QuoteLineItems)
FROM Quote WHERE id =
:System.currentPageReference().getParameters().get('id')];
}
}
Thank you!!
you can use extension controller to get QuoteLineItems and can write the logic to save that in the controller .Let me know if you get any issues.