Opening an Opportunity in a new window via a URL in a report RRS feed

  • Question

  • Hi,

    I have an SSRS report developed in MS 2008. I'm trying to open an Opportunity in a new window, but it's not working. I can open a Contact in a new window, but the Opportunity link doesn't work.

    I can open an Opportunity in the same window using the following expression for 'Action>Go to URL' in the SSRS report:

    =Parameters!CRM_OpportunityURL.Value & Parameters!ContactId.Value.ToString & "%257d %26_CreateFromType%3d2%26_gridType%3d3%26etc%3d3%26id
    %3d%257b" & Fields!opportunityid.Value.ToString & "%257d%26rskey%3d611818184&pagetype=entityrecord"

    Here is the full URL is produces: http://basevm/Mycompany/main.aspx?etc=3&extraqs=%3f_CreateFromId%3d%257b753D2C9E-5F2C-E411-9D8C-00155D3FE201%257d %26_CreateFromType%3d2%26_gridType%3d3%26etc%3d3%26id%3d%257b50CAAAA4-2143-E411-BC10-00155D3FE201%257d%26rskey%3d611818184&pagetype=entityrecord

    That works fine for opening in the same window.

    Here is my expression for opening a Contact in a DIFFERENT window:

    ="javascript:void(window.open('" & Parameters!CRM_URL.Value + Parameters!ContactId.Value + "%257d&pagetype=entityrecord','_blank'))"

    That also works perfectly.

    Here is the full URL it produces: http://basevm/MyCompany/main.aspx?etc=2&extraqs=%3fetc%3d2%26id%3d%257b753D2C9E-5F2C-E411-9D8C-00155D3FE201%257d&pagetype=entityrecord

    So, as you can see, I can get a Contact to open in a new window, but not an Opportunity.

    Here is my expression for opening an Oportunity in a new window:

    ="javascript:void(window.open('http://basevm/Mycompany/main.aspx?etc=3&extraqs=%3f_CreateFromId%3d%257b95283337-F331-E411-9069-00155D3FE201%257d%20%26_CreateFromType%3d2%26_gridType%3d3%26etc%3d3%26id%3d%257bedb7fdd5-a832-e411-9069-00155d3fe201%257d%26rskey%3d611818184&pagetype=entityrecord', '_blank'))"

    I just hard-coded in the values this time, the URL works fine on its own, but creates an error when I upload the report to the report server. This is the error I'm getting in the trace file:

    [2014-09-29 13:56:37.572] Process: w3wp |Organization:00000000-0000-0000-0000-000000000000 |Thread:    3 |Category: Platform |User: 00000000-0000-0000-0000-000000000000 |Level: Error | ExceptionConverter.ConvertMessageAndErrorCode
     at ExceptionConverter.ConvertMessageAndErrorCode(Exception exception, Int32& errorCode)
     at ExceptionConverter.ToSingleFaultOther(Exception exception)
     at ExceptionConverter.ToSingleFaultUntyped(Exception exception)
     at ExceptionConverter.ConvertToFault(Exception exception)
     at ExceptionConverter.TryConvertToFaultExceptionInternal(Exception exception, Boolean createNewFaultException, FaultException`1& faultException)
     at FaultHelper.ConvertToFault(Exception exception)
     at ErrorInformation..ctor(Exception exception, Uri requestUrl, Boolean logError)
     at MainApplication.Application_Error(Object sender, EventArgs eventArguments)
     at EventHandler.Invoke(Object sender, EventArgs e)
     at HttpApplication.RaiseOnError()
     at ApplicationStepManager.ResumeSteps(Exception error)
     at HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData)
     at HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)
     at ISAPIRuntime.ProcessRequest(IntPtr ecb, Int32 iWRType)
    >System.FormatException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #10DC24CE: System.FormatException: Input string was not in a correct format.
    >   at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
    >   at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
    >   at Microsoft.Crm.Web.MainPage.get_CurrentEntity()
    >   at Microsoft.Crm.Web.MainPage.SetContentUrl()
    >   at Microsoft.Crm.Web.MainPage.ConfigurePage()
    >   at Microsoft.Crm.Application.Controls.PageManager.OnPreRender(EventArgs e)
    >   at System.Web.UI.Control.PreRenderRecursiveInternal()
    >   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


    Monday, September 29, 2014 12:59 PM

All replies

  • I think you are slightly off track with the url.

    Please follow the instructions to open entities in new window.

    1. Create a new report in CRM using reports wizard.

    2. Add opportunity as entity

    3. Add subject as a field.

    4. run the report, hover over the subject and click the subject name.

    5. you can see that the opportunity record opens in a new window.

    6. Edit the report in report builder, you can see that the entityname and opportunity id is passed as variables

    modify your report to use the drillopen.aspx, rather than using javascript.

    Let me know if you need any help,



    Monday, September 29, 2014 1:54 PM
  • Thanks for your reply.

    This is the URL I get from clicking on subject:


    That works fine when I copy & paste it into a browser, but it does not work when I use the javascript. How do I use drillopen.aspx? I don't know if I can use that for a expression in a table cell in SSRS.

    I'm wondering why the contact URL works fine for me, but the Opportunity one does not?

    Monday, September 29, 2014 2:21 PM
  • Please follow my instructions on my previous post. The action I see on my text box is

    =IIf(IsNothing(Fields!opportunityid.Value), Nothing, String.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}?ID={1}&LogicalName={2}", Parameters!CRM_URL.Value, Fields!opportunityid.Value, "opportunity"))

    Tuesday, September 30, 2014 1:03 AM