[SalesForce] Salesforce Report not showing records in run mode but are shown in edit mode

I am experiencing a strange behaviour from a Salesforce report, since when i am in edit mode it shows more records than when i run the report.
I created a custom report type on "Opportunity" with another custom object called "Sales Report", i tried both "with" and "with or without" options for the relationship, but i am having the same results.
Here is an example when i filter on a custom field called "Biz Unit", in edit mode i have 20 records returning :
enter image description here

But when i run the the report with the same filter i get only 7 records :
enter image description here

And with a query to filter the same custom field i get 658 records :
enter image description here

And what is more strange, i tried to filter on single Opportunity that i know satisfies the filter and was showing in the report in edit mode :
enter image description here

But when i run the report no records are returned :
enter image description here

And here is the SOQL query :
enter image description here

I'm really out of ideas, as i cannot find an explanation to this behaviour of reports.

Thank you in advance for your help !

Best Answer

The behaviour reported is similar to the known issue which is currently under review status(yet to be fixed). The workaround would be to ensure all users are assigned to a role will allow all records to be seen, taking into consideration all other sharing and visibility factors.

Update: I have reached out to the Salesforce product development team internally for the root cause and below are few observations:

  1. For non-joined CRT, it seems we enforce a role selection on save. So if you change the filter to "All opportunities" and run, it shows everything, but if you save and reload the page, you will notice in the filter panel that the user role is auto-selected. You can click on Clear Selection in the role panel and run and get all the records again, but once saved, it goes back to the user role selected. This behavior is not happening for SRT.
  2. For joined report, we do not allow role filters, and role selection is not shown on the UI. That is possibly where the difference between edit page and run page come into the picture, preview is showing a true "All Opportunities" report while run page is showing "All opportunities under role" report, thus less records This also explains why non-joined report show all opportunities on the first run and then on refresh show limited results.

No workaround, other than having the same role for users known for joined reports so far. For regular reports, user can Clear role selection in the role filter panel to get all opportunities.

Also please note that there is a difference between a user with no role and user in the role hierarchy. So if some opportunities are owned by a user with a role and some by a user without role, the user without role will only see oppt owned by themselves and other users without role in joined report run page.

-Salesforce Support

Related Topic