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
Firas Taamallah 12Firas Taamallah 12 

Why

I runned this soql to find Account with opportunitie with orders  :
 
SELECT
  Name,
  (SELECT
    LastModifiedDate, CreatedDate, StageName,Name
   FROM 
   Opportunities),
   (SELECT
     OrderNumber
    FROM
     Orders)
FROM 
  Account

I found data :

DataBut when i tried to use report in salesforce , i couln't find that opportunities which is related to that account

noDataDoes anyone have  an explanation please?
Kiran Kumar( Personal )Kiran Kumar( Personal )

Hi,

When you ran the query, it gives you All the Accounts , All the Opportunities and All the Orders.This is because your query, queries for all these different type of records.

Case 2 :
A report results depend on the report type used and the settings for the report type.
Will explain you with an example : 

Object A is parent of Object B, and Object B is parent of Object C. 
 

  • If there are 10 Obj A records and only 5 of them have Obj B records and you are running the report, (depends on report settings), you may be able to see only t hose ObjA records where there are Obj B child records. If there is no child record for an Obj A record, you may not see the Obj A record in the Report. So here you see only 5 Obj A records that have Obj B records.
  • If there are 10 Obj A records and 5 Obj A records have assoicated B records. and from the 5 B records, only 2 has Obj C records. Here when you run a report type, you may see only some account records. This will happen in case the report type configuration is set like All Obj A records with Atlest One Obj B record .........

Hope you could understand. In case not, please let me know will try to answer your questions if you have any.

In case this helped, mark this as best answer :) 

Firas Taamallah 12Firas Taamallah 12
Thanks @Kiran for your answer but why i couldn't find data on the report even when the report is based on report type :

Report type : Primary object  Order  , i've added  Opportunity name - Account name via lookup to the layout
Use Case : i want to see  oders per opportunity / quote 

I even used opportunities as report type , and i added cross filter " Opportunities with orders " but there's no data on the data
Can you please help me on how to retrieve opportunities that have orders ? Thanks