Skip to main content
Hi all, 

I'm having a problem related child objects using SOQL. In preparation for another object that has yet to be created, I made corrections to my custom object name, though now I can only query related child records using the old (wrong) name. My code here shows that now, the system recognizes both:

 

// Query child "Checklist_Item_Junctions__r" even though that is no longer the object's name

List<Checklist_Template__c> templateQuery = [Select Id, Machine_Series__c, (Select Id, Checklist_Template__c, Checklist_Template_Item__c From Checklist_Item_Junctions__r) From Checklist_Template__c];

        

        

        // separately query all "Checklist_Template_Item_Junction__c" records, (the new name of the object)

        List<Checklist_Template_Item_Junction__c> junctionQuery = [Select Id, Checklist_Template__c, Checklist_Template_Item__c From Checklist_Template_Item_Junction__c];

      

This saves successfully, and I have no idea why. There is no longer such an object as "Checklist_Item_Junction__c", but it's requiring that I call it that in my child relationship query.

 
6 answers
  1. Mar 18, 2019, 7:05 PM
    Hi Jason ,

    Try going to the lookup field of custom object and check whether the name of child relationship is correct or not . Rename it with name that you want to use.

    Hi Jason ,Try going to the lookup field of custom object and check whether the name of child relationship is correct or not . Rename it with name that you want to use.

    Hope this helps :)
Loading
0/9000