• Jonathan Jacobs
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
I have a visualforce page I am working on in which I am trying to edit a list of related records in a table format and save all the records with a single save button.  I created a purchase order object and a related purchase order products, which is the individual line item records that will go on the purchase order.  I used the Editing a Table of Data in a Page as my basis for creating the editiable table in visualforce.  The table draws in the related items for the purchase order.  I'm having trouble figuring out how to customize the save button to save the changes in the table.  I believe the save button is using the standard controller and trying to save the purchase order record.  I would like to customize the save button so that it can save the purchase order items in the editable table.  I'm learning how to code and i'm not sure how to set this up.  I'm thinking a controller extension to customize the save button, but I'm not sure how this would be coded.  Any help would be appreciated.  

Here is an example of the page currenlty
Example Purchase Order

And here is my current Visualforce Code
 
<apex:page standardController="Purchase_Order__c" >
    <apex:slds />
    <apex:detail inlineEdit="true"/>
   
    <!--<flow:interview name="AddProduct" />-->
    
    <apex:form> 
	<apex:pageBlock title="Purchase Order Items">
      <apex:pageBlockTable value="{!Purchase_Order__c.Purchase_Order_Products__r}" var="POLI">
      
        <apex:column value="{!POLI.POLI_Part_Number__c}"/>
        <apex:column value="{!POLI.Catalog_Number__c}"/>
        <apex:column value="{!POLI.UOM__c}"/>
        <apex:column value="{!POLI.ordered__c}"/>
        <apex:column headerValue="Backordered">
            <apex:inputField value="{! POLI.Backordered__c }"/>
        </apex:column>
        <apex:column headerValue="Received">
            <apex:inputField value="{! POLI.Received__c }"/>
        </apex:column>
        <apex:column headerValue="RMA">
            <apex:inputField value="{! POLI.RMA__c }"/>
        </apex:column>
      </apex:pageBlockTable>

   <apex:pageMessages />
   <apex:pageBlockButtons>
      <apex:commandButton value="Save" action="{!save}"/>
   </apex:pageBlockButtons>

   </apex:pageBlock>
   </apex:form>
</apex:page>

 
I have a visualforce page I am working on in which I am trying to edit a list of related records in a table format and save all the records with a single save button.  I created a purchase order object and a related purchase order products, which is the individual line item records that will go on the purchase order.  I used the Editing a Table of Data in a Page as my basis for creating the editiable table in visualforce.  The table draws in the related items for the purchase order.  I'm having trouble figuring out how to customize the save button to save the changes in the table.  I believe the save button is using the standard controller and trying to save the purchase order record.  I would like to customize the save button so that it can save the purchase order items in the editable table.  I'm learning how to code and i'm not sure how to set this up.  I'm thinking a controller extension to customize the save button, but I'm not sure how this would be coded.  Any help would be appreciated.  

Here is an example of the page currenlty
Example Purchase Order

And here is my current Visualforce Code
 
<apex:page standardController="Purchase_Order__c" >
    <apex:slds />
    <apex:detail inlineEdit="true"/>
   
    <!--<flow:interview name="AddProduct" />-->
    
    <apex:form> 
	<apex:pageBlock title="Purchase Order Items">
      <apex:pageBlockTable value="{!Purchase_Order__c.Purchase_Order_Products__r}" var="POLI">
      
        <apex:column value="{!POLI.POLI_Part_Number__c}"/>
        <apex:column value="{!POLI.Catalog_Number__c}"/>
        <apex:column value="{!POLI.UOM__c}"/>
        <apex:column value="{!POLI.ordered__c}"/>
        <apex:column headerValue="Backordered">
            <apex:inputField value="{! POLI.Backordered__c }"/>
        </apex:column>
        <apex:column headerValue="Received">
            <apex:inputField value="{! POLI.Received__c }"/>
        </apex:column>
        <apex:column headerValue="RMA">
            <apex:inputField value="{! POLI.RMA__c }"/>
        </apex:column>
      </apex:pageBlockTable>

   <apex:pageMessages />
   <apex:pageBlockButtons>
      <apex:commandButton value="Save" action="{!save}"/>
   </apex:pageBlockButtons>

   </apex:pageBlock>
   </apex:form>
</apex:page>