You need to sign in to do that
Don't have an account?
jroyalty
Saving OpportunityLineItems isn't working
Hello,
I'm trying to set up a custom page so that I can add some references for the Opportunity List Item page. Unfortunately, when I try to Save my edited values nothing changes in the records. I would like to do this only using a standard controller. Here's the code I'm using just for this test:
<apex:page standardController="Opportunity" tabstyle="opportunity"> <apex:form > <apex:pageBlock > <apex:pageBlockTable value="{!Opportunity.opportunitylineitems}" var="a"> <apex:column headerValue="Price"> <apex:inputField value="{!a.quantity}"/> </apex:column> </apex:pageBlockTable> <apex:commandButton value="Save" action="{!quicksave}"/> </apex:pageBlock> </apex:form> </apex:page>
Is there something I can do to set it up to properly be able to save the modified line item values?
Any help would be appreciated.
Thanks!
Oh, I'm sorry, I responded too fast when I saw the "quicksave" thing. All the actions you get from the standardController are actions on the Opportunity Record itself. However, you're making changes to the LineItems, and those are different records. The "save" doesn't propogate down to the related list of objects.
So, I think you need a simple extension which, upon save, would issue an update for the List of OpportunityLineItems that are referred to in the Opportunity.
Best, Steve
All Answers
What is: "quicksave"?
try
action="{!Save}"
instead.
Best, Steve.
p.s. Header = "Price", value = "Quantity"... misleading to say the least! :-) (Although I realize it's just a test...)
Quicksave does a save without leaving the page, it was an artifact of a test I was doing to try to resolve the problem.
Save does not work either.
Oh, I'm sorry, I responded too fast when I saw the "quicksave" thing. All the actions you get from the standardController are actions on the Opportunity Record itself. However, you're making changes to the LineItems, and those are different records. The "save" doesn't propogate down to the related list of objects.
So, I think you need a simple extension which, upon save, would issue an update for the List of OpportunityLineItems that are referred to in the Opportunity.
Best, Steve
Thank you, I'll look into doing that.
did you ever do this? would be nice to share the actual solution for newbs like me.
Thanks :)