Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Dynamic Report Does not work

Posted on by 450

Hi there all experts.
I have created a custom entity named new_serviceds.
It has  N:1 relation with quote and sales order, which means every quote can has an number of new_serviceds records,so sales order can have.
I have created a report based on the filteredview.
When I try the record without filteredview in the MS SQL server it works fine and return the result set.
It is the query without filteredview :

 select new_serviceds.new_service_name, new_serviceds.new_estimated_day,
 new_serviceds.new_estimated_amt from new_serviceds
 inner join SalesOrder on (salesorder.QuoteId=new_serviceds.new_arvand_service_to_quoteId)
 where salesorder.SalesOrderId='xxxx-xxxxx-xxxxx-xxxxxx-xxxx';


the query works fine in sql server query.
I wanna run this report in the sales order record, in each record it returns me the result set.
Here is with the filtered view  :

 select  Filterednew_serviceds.new_service_name, 
 Filterednew_serviceds.new_estimated_amt, Filterednew_serviceds.new_estimated_day 
 from filterednew_serviceds
  inner join filteredsalesorder on
   (Filterednew_serviceds.new_service_to_quoteId = filteredsalesorder.QuoteId)
  where Filteredsalesorder.SalesOrderId = (@CRM_SalesOrderId) ;

And here is the query that returns CRM_SalesOrderId :

SELECT  salesorderid
FROM   FilteredSalesOrder AS CRMAF_SalesOrderId;



But with out the filtered view in the sql server management, the query return result.
Where I am doing wrong?

*This post is locked for comments

  • Verified answer

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans