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
Mohit KapoorMohit Kapoor 

Not able to edit a child record in nested Query

Hi, I have a code.
public class sample1
{    
    public List<City_of_NY_Projects__c> acct {get;set;}
    public  sample1()
    {
        acct = [SELECT Name, (SELECT Name,Step__c,Phase__c,Version__c,Stage__c,Predecessor__c,Start_Date__c,End_Date__c,Stage_Duration__c,Stage_Duration_2__c,Duration_On_Hold__c,Actual_End_Date__c,Resource_Name__c FROM City_of_NY_Project_Timeline__r WHERE VF_Criteria__c = 'true') FROM City_of_NY_Projects__c limit 5];

    
    } 
    
    public string editItem {get;set;}

public pageReference editBtn() {
        return null;
}
  
  public pageReference cancelBtn() {
        editItem = null;
        return null;
}
  
  public PageReference saveBtn() {
  
    
      update acct;

                   
            editItem = null;
          
           return null;
}
       
}

I need to update City of NY Timeline record, which is the child record. Any idea how to modify this.
Sumitkumar_ShingaviSumitkumar_Shingavi
Can you elaborate your requirement little more as how you will identify a specific City_of_NY_Projects__c IDs for which you need to fetch City_of_NY_Project_Timeline__c records? Are you using standardController in VF as "City_of_NY_Projects__c"?