locked
Using a parameter in a report RRS feed

  • Question

  • select customeridname, hi_machinelistidname, hi_queue, title, createdon, createdbyname, incidentid from incident where (owneridname ='CRM Admin'  and hi_queue = @OfficeQueue)
    I have a simple select statement that I'm trying to use a parameter with.   In SQl, in the data tab, the statement runs perfectly, but when I go to Preview I get errors.  I have defined the parameter as OfficeQueue datatype=String
    Available values:
    From Query

    I get errors like:

    The report parameter 'OfficeQueue' has a DefaultValue that depends on the report parameter "OfficeQueue". Forward dependencies are not valid.


    Where am I going wrong with this?  I have tried using a second dataset to return all results for hi_queue but got different errors.

    Monday, July 27, 2009 10:19 PM

Answers

All replies

  • Hi - reorder the list of parameters in the report so that the officeQueue parameter is later in the list than it currently is.


    Scott Sewell, CustomerEffective | http:\\blog.CustomerEffective.com | Twitter:@ScottSewell
    Tuesday, July 28, 2009 2:04 AM
    Moderator
  • I only have one parameter so I don't think I can reorder it.
    Tuesday, July 28, 2009 4:33 AM
  • try to refresh your dataset by clicking the refresh button and then execute your dataset before you go preview your report to see if it works for you. If that doesn't work, close visual studio and open the project up again to see if it works. Sometimes it's cached.


    Darren Liu | 刘嘉鸿 | MS CRM MVP | English Blog: http://msdynamicscrm-e.blogspot.com | Chinese Blog: http://liudarren.spaces.live.com
    Tuesday, July 28, 2009 5:02 AM
    Moderator
  • It sounds to me like the default value of your OfficeQueue parameter is set to come from a query (i.e. data set), and that query has OfficeQueue defined as a parameter, hence the error. The solution is to use a 2nd query to set the parameter's default value
    Microsoft CRM MVP - http://mscrmuk.blogspot.com  http://www.excitation.co.uk
    Tuesday, July 28, 2009 5:11 AM
    Moderator
  • Perfect!!!! Thanks.    The 2nd dataset got it to work.

    Tuesday, July 28, 2009 2:29 PM