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
fiona gentryfiona gentry 

Why No data in Junction Object whereas parent objects has records

i have created a Junction object as below
User-added image

But when I type below query I don't see data why?
select Id from Case_ERT_Junc__c
User-added image
ANUTEJANUTEJ (Salesforce Developers) 
Hi Fiona,

I tried checking and I was able to get the reference  id's of that particular parent records when I queried on the parent object, can you mention if you are trying to get only the record id's or the whole record details?

Looking forward to hearing back from you.

Regards,
Anutej
fiona gentryfiona gentry
Basically I want to create a report_type from both parent objects hence created this junction object(child),now to achieve this created a Junction(child) object which has master detail relationship from both parents  ,so  when I query this junction(child ) object I should be able to see all fields and records from both parent objects but I don't see any records or data
ANUTEJANUTEJ (Salesforce Developers) 
So, I tried checking and found these two links that you could check for clarification, could you please have a look at them once as there are examples of same but on different objects:

>> https://developer.salesforce.com/forums/?id=9060G0000005iscQAA

>> https://salesforce.stackexchange.com/questions/83029/retrieving-updating-record-related-by-junction-object-with-single-soql-query

I hope they could help you in building an soql query that could query the fields according to your use case.

In case if this comes handy can you please choose this as best answer so that it can be used by others in the future.