Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 82002

Dynamic Report Does not work

$
0
0

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?


Viewing all articles
Browse latest Browse all 82002

Latest Images

Trending Articles



Latest Images