function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
XIOXIO 

Visualforce page copying text field data across all related child records - HELP!

Hello,

I'm having an issue with the Visualforce page below. When I inline-edit from the VFpage and refresh, the data from the text fields on the child records copy accross all child records. Any assistance is will be greatly appreciated!!

BEFORE VFPage Inline-Edit
Before Edit
AFTER VFPage Inline-Edit
After Edit

Controller:
public class SuccessPlanningController {

    Public List<Initiatives__c> IntList{get;set;}
    
    public String contId{get;set;} 
    public String dcid{get;set;}
    public Initiatives__c Intobj{get;set;}
    Public string editid{get;set;} 
    public Success_Plan__c SP {get;set;}
    public Id selectedDetailID { get;set; }
    public String s{get;set;}
    
   
    String currentRecordId ; 
    public SuccessPlanningController (ApexPages.StandardController controller) {
       // this.oppty= (Success_Plan__c)controller.getRecord();
   s='';
   currentRecordId  = ApexPages.CurrentPage().getparameters().get('id');
   SP=[Select id,name,(select id,name,Name_Formula__c,Source_Formula__c,Status_Formula__c,SBC_Formula__c,Confirmed_Formula__c,TimeframeINSERT__c,Action_ItemINSERT__c,ProgressINSERT__c,OwnerINSERT2__c,OwnerINSERT__c,Description__c,Owner__c,FreeText__c,Timeframe__c,Progress__c,Confirmed__c,Action_Items__c,Action_ItemF__c,Action_ItemsRICHTEXT__c,Source__c,Service_Business_Challenge__c,Initiative_Owner__c, Service_Discipline__c,In_Success_Plan__c,Initiative_Record__c,Status__c,Order__c from Initiatives__r where In_Success_Plan__c=True  ORDER BY Order__c ASC) from Success_Plan__c where id=:currentRecordId ];
     
    
   if(SP==null)
   {
    Apexpages.addMessage(new ApexPages.Message(ApexPages.Severity.INFO,''+'No Initiatives to Display'));
   } 
 }
     
    public PageReference save()
    {
    system.debug('sssssssssssssuuuu'+SP);
        upsert SP.Initiatives__r;
        
    PageReference pageRef = new PageReference('/apex/SuccessPlanning');
    pageRef.setRedirect(true);
    return null;    }  
     
     
       public pagereference deleteCon() {
       String s1 = System.CurrentPageReference().getParameters().get('dtlIdParam');
       Initiatives__c t=[ select id,In_Success_Plan__c From Initiatives__c Where id=:s1];
       t.In_Success_Plan__c =false;
      
       upsert t;
       PageReference pageRef = new PageReference('/apex/SuccessPlanning');
       pageRef.setRedirect(true);
       return null;
   } 
    
 
   
   
}

Visualforce Page:
<apex:page standardController="Success_Plan__c" extensions="SuccessPlanningController"  >
<apex:sectionHeader title="Initiatives"/>
<apex:form >
<div align="center">
<apex:commandButton value="Save" action="{!save}" id="saveButton" />
</div>
<apex:pageBlock id="pb">
<apex:pageMessages />
<!--  <div align="center" draggable="false" >
<apex:commandButton action="{!save}" value="Save" id="theButton"  /> </div> -->

<apex:pageBlockTable value="{!SP.Initiatives__r}" var="d">

<apex:column headerValue="Order">   
<apex:outputField value="{!d.Order__c}">  
<apex:inlineEditSupport event="ondblclick" />                      
</apex:outputField> </apex:column>

<apex:column headerValue="Initiatives">   
<apex:outputField value="{!d.Name_Formula__c}">  
<apex:inlineEditSupport event="ondblclick" />                      
</apex:outputField> </apex:column>

<apex:column headerValue="Source">   
<apex:outputField value="{!d.Source__c}">  
<apex:inlineEditSupport event="ondblclick" />                      
</apex:outputField> </apex:column>

<apex:column headerValue="Status">   
<apex:outputField value="{!d.Status__c}">  
<apex:inlineEditSupport event="ondblclick" />                      
</apex:outputField> </apex:column>

<apex:column headerValue="Service Business Challenge">   
<apex:outputField value="{!d.Service_Business_Challenge__c  }">  
<apex:inlineEditSupport event="ondblclick" />                      
</apex:outputField> </apex:column>

<apex:column headerValue="Action Items">   
<apex:outputField value="{!d.Action_ItemsRICHTEXT__c}">  
<apex:inlineEditSupport event="ondblclick" />                      
</apex:outputField> </apex:column>

<apex:column headerValue="Owner">   
<apex:outputField value="{!d.Owner__c}">  
<apex:inlineEditSupport event="ondblclick" />                      
</apex:outputField> </apex:column>

<apex:column headerValue="Timeframe">   
<apex:outputField value="{!d.Timeframe__c}">  
<apex:inlineEditSupport event="ondblclick" />                      
</apex:outputField> </apex:column>

<apex:column headerValue="Progress">   
<apex:outputField value="{!d.Progress__c}">  
<apex:inlineEditSupport event="ondblclick" />                      
</apex:outputField> </apex:column>

<apex:column headerValue="Confirmed">   
<apex:outputField value="{!d.Confirmed__c}">  
<apex:inlineEditSupport event="ondblclick" />                      
</apex:outputField> </apex:column>

<apex:column headerValue="Action">   
<apex:outputField value="{!d.Initiative_Record__c}">  
<apex:inlineEditSupport event="ondblclick" />                      
</apex:outputField> </apex:column>

<apex:column headerValue="Action">
<apex:commandLink value="Remove" action="{!deleteCon}" reRender="pb"  oncomplete="window.top.location = '/{!Success_Plan__c.id}';">
<apex:param value="{!d.id}" assignTo="{!dcid}" name="dtlIdParam"/>
</apex:commandLink>
</apex:column>                
<apex:inlineEditSupport event="ondblClick" showOnEdit="saveButton,cancelButton" hideOnEdit="editButton" /> 
</apex:pageBlockTable>

</apex:pageblock>
</apex:form>
</apex:page>