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

Changing Subgrid filter throwing error in dynamics crm 2015

$
0
0

Good afternoon. I am running into a REALLY wierd issue trying to change a datagrid, and google hasn't been any luck. I am using the below javascripts to set the fetch and layout of a subgrid called "Opp_Prods".

    function timeOutReassignFilter()
    {
    console.log("About to setTimeout");
        setTimeout(SetProductView, 1000);
    console.log("Set TimeOut");
    }

    function SetProductView()
    {
    try
    {
    var accountId = Xrm.Page.data.entity.getId();
    var viewId = '{00000000-0000-0000-0000-000000000001}';
    var entityName = "opportunityproduct";
    var viewDisplayName = "Associated Opportunity Products View";

    console.log("About to set fetchxml: " + accountId);
    var fetchXml = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>" +
      "<entity name='opportunityproduct'>" +
        "<attribute name='productid' />" +
        "<attribute name='productdescription' />" +
        "<attribute name='priceperunit' />" +
        "<attribute name='quantity' />" +
        "<attribute name='new_serialnumber' />" +
        "<attribute name='extendedamount' />" +
        "<attribute name='opportunityproductid' />" +
        "<order attribute='productid' descending='false' />" +
        "<link-entity name='opportunity' from='opportunityid' to='opportunityid' alias='ac'>" +
          "<filter type='and'>" +
            "<condition attribute='parentaccountid' operator='eq' value='" + accountId + "' />" + //uiname='Test Account'
          "</filter>" +
        "</link-entity>" +
      "</entity>" +
    "</fetch>";

    console.log("About to set layoutXml");
    var layoutXml = "<grid name='Opp_Prods' object='1' jump='productid' select='1' icon='1' preview='1'>" +
        "<row name='result' id='myproductid'>" +
            "<cell name='productdescription' width='150' />" +
            "<cell name='productid' width='150' />" +
            "<cell name='priceperunit' width='150' />" +
            "<cell name='quantity' width='150' />" +
            "<cell name='extendedamount' width='150' />" +
            "<cell name='new_serialnumber' width='150' />" +
            "<cell name='opportunityproductid' width='150' />" +
        "</row>" +
    "</grid>";

    console.log("About to set Control by adding custom view.");
    //    Xrm.Page.getControl("opp_prods").addCustomView(viewId, entityName, viewDisplayName, fetchXml, layoutXml, true);

    document.getElementById("Opp_Prods").control.SetParameter("fetchXML", fetchXml);
    document.getElementById("Opp_Prods").control.SetParameter("layoutXML", layoutXml);
    Xrm.Page.ui.controls.get("Opp_Prods").refresh();
    console.log("Custom View Added.");
    }
    catch(err)
    {
    console.log(err);
    }
    }

When the form loads, it's throwing the following error:

> Unhandled Exception:
> System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault,
> Microsoft.Xrm.Sdk, Version=7.0.0.0, Culture=neutral,
> PublicKeyToken=31bf3856ad364e35]]: System.Xml.XmlException: Microsoft
> Dynamics CRM has experienced an error. Reference number for
> administrators or support: #E63BFD86Detail:  <OrganizationServiceFault
> xmlns:i="www.w3.org/.../XMLSchema-instance"
> xmlns="schemas.microsoft.com/.../Contracts"> 
> <ErrorCode>-2147220970</ErrorCode>   <ErrorDetails
> xmlns:d2p1="schemas.datacontract.org/.../System.Collections.Generic"
> />   <Message>System.Xml.XmlException: Microsoft Dynamics CRM has
> experienced an error. Reference number for administrators or support:
> #E63BFD86</Message>   <Timestamp>2015-08-25T16:13:21.2028543Z</Timestamp>   <InnerFault>
>     <ErrorCode>-2147220970</ErrorCode>
>     <ErrorDetails xmlns:d3p1="schemas.datacontract.org/.../System.Collections.Generic"
> />
>     <Message>System.InvalidCastException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support:
> #F2D68509</Message>
>     <Timestamp>2015-08-25T16:13:21.2028543Z</Timestamp>
>     <InnerFault i:nil="true" />
>     <TraceText i:nil="true" />   </InnerFault>   <TraceText i:nil="true" /> </OrganizationServiceFault>

And here's the full trace from our CRM trace logs:

> [2015-08-25 11:24:37.314] Process: w3wp
> |Organization:f6d279c3-1548-e511-80bd-00155d001302 |Thread:  118
> |Category: Application |User: 00000000-0000-0000-0000-000000000000
> |Level: Error |ReqId: 021d486e-5560-4f4e-a87a-a138ee9f8f3f |
> ErrorInformation.LogError  ilOffset = 0x17
> >MSCRM Error Report:
> -------------------------------------------------------------------------------------------------------- Error: System.InvalidCastException: Unable to cast object of type
> 'System.DBNull' to type 'Microsoft.Xrm.Sdk.OptionSetValue'.    at
> Microsoft.Crm.Application.Controls.Grid.UI.PropertyTemplatePropertiesConfigurationColumn.BindData(WebControl
> parentControl, IRowDataSource rowData)    at
> System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding)    at
> System.Web.UI.Control.DataBindChildren()    at
> System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding)    at
> System.Web.UI.WebControls.GridView.CreateRow(Int32 rowIndex, Int32
> dataSourceIndex, DataControlRowType rowType, DataControlRowState
> rowState, Boolean dataBind, Object dataItem, DataControlField[]
> fields, TableRowCollection rows, PagedDataSource pagedDataSource)  
> at System.Web.UI.WebControls.GridView.CreateChildControls(IEnumerable
> dataSource, Boolean dataBinding)    at
> System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable
> data)    at
> System.Web.UI.WebControls.GridView.PerformDataBinding(IEnumerable
> data)    at
> System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable
> data)    at System.Web.UI.WebControls.DataBoundControl.PerformSelect()
> at
> Microsoft.Crm.Application.Controls.Grid.UI.LayoutProviderGridList.RenderGridData(HtmlTextWriter
> output)    at
> Microsoft.Crm.Application.Controls.Grid.UI.LayoutProvider.Render(HtmlTextWriter
> output)    at
> Microsoft.Crm.Application.Controls.GridUIProvider.Render(HtmlTextWriter
> output)    at
> Microsoft.Crm.Core.Application.WebServices.AppGridWebServiceHandler.GetRefreshResponseHtml(IGridUIProvider
> uiProvider, StringBuilder sbTemp)    at
> Microsoft.Crm.Core.Application.WebServices.AppGridWebServiceHandler.Refresh(String
> gridXml, StringBuilder sbXml, StringBuilder sbHtml, Boolean
> returnJsonData)    at
> Microsoft.Crm.Core.Application.WebServices.AppGridWebServiceHandler.ProcessRequestInternal(HttpContext
> context)
>
> Error Message: System.InvalidCastException: Unable to cast object of
> type 'System.DBNull' to type 'Microsoft.Xrm.Sdk.OptionSetValue'.    at
> Microsoft.Crm.Application.Controls.Grid.UI.PropertyTemplatePropertiesConfigurationColumn.BindData(WebControl
> parentControl, IRowDataSource rowData)    at
> System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding)    at
> System.Web.UI.Control.DataBindChildren()    at
> System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding)    at
> System.Web.UI.WebControls.GridView.CreateRow(Int32 rowIndex, Int32
> dataSourceIndex, DataControlRowType rowType, DataControlRowState
> rowState, Boolean dataBind, Object dataItem, DataControlField[]
> fields, TableRowCollection rows, PagedDataSource pagedDataSource)  
> at System.Web.UI.WebControls.GridView.CreateChildControls(IEnumerable
> dataSource, Boolean dataBinding)    at
> System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable
> data)    at
> System.Web.UI.WebControls.GridView.PerformDataBinding(IEnumerable
> data)    at
> System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable
> data)    at System.Web.UI.WebControls.DataBoundControl.PerformSelect()
> at
> Microsoft.Crm.Application.Controls.Grid.UI.LayoutProviderGridList.RenderGridData(HtmlTextWriter
> output)    at
> Microsoft.Crm.Application.Controls.Grid.UI.LayoutProvider.Render(HtmlTextWriter
> output)    at
> Microsoft.Crm.Application.Controls.GridUIProvider.Render(HtmlTextWriter
> output)    at
> Microsoft.Crm.Core.Application.WebServices.AppGridWebServiceHandler.GetRefreshResponseHtml(IGridUIProvider
> uiProvider, StringBuilder sbTemp)    at
> Microsoft.Crm.Core.Application.WebServices.AppGridWebServiceHandler.Refresh(String
> gridXml, StringBuilder sbXml, StringBuilder sbHtml, Boolean
> returnJsonData)    at
> Microsoft.Crm.Core.Application.WebServices.AppGridWebServiceHandler.ProcessRequestInternal(HttpContext
> context)
>
> Source File: Not available
>
> Line Number: Not available
>
> Request URL:
> manufacturingdemo.crm2015.cloudappsonline.net/.../AppGridWebService.ashx
>
> Stack Trace Info: [InvalidCastException: Unable to cast object of type
> 'System.DBNull' to type 'Microsoft.Xrm.Sdk.OptionSetValue'.]    at
> Microsoft.Crm.Application.Controls.Grid.UI.PropertyTemplatePropertiesConfigurationColumn.BindData(WebControl
> parentControl, IRowDataSource rowData)    at
> System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding)    at
> System.Web.UI.Control.DataBindChildren()    at
> System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding)    at
> System.Web.UI.WebControls.GridView.CreateRow(Int32 rowIndex, Int32
> dataSourceIndex, DataControlRowType rowType, DataControlRowState
> rowState, Boolean dataBind, Object dataItem, DataControlField[]
> fields, TableRowCollection rows, PagedDataSource pagedDataSource)  
> at System.Web.UI.WebControls.GridView.CreateChildControls(IEnumerable
> dataSource, Boolean dataBinding)    at
> System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable
> data)    at
> System.Web.UI.WebControls.GridView.PerformDataBinding(IEnumerable
> data)    at
> System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable
> data)    at System.Web.UI.WebControls.DataBoundControl.PerformSelect()
> at
> Microsoft.Crm.Application.Controls.Grid.UI.LayoutProviderGridList.RenderGridData(HtmlTextWriter
> output)    at
> Microsoft.Crm.Application.Controls.Grid.UI.LayoutProvider.Render(HtmlTextWriter
> output)    at
> Microsoft.Crm.Application.Controls.GridUIProvider.Render(HtmlTextWriter
> output)    at
> Microsoft.Crm.Core.Application.WebServices.AppGridWebServiceHandler.GetRefreshResponseHtml(IGridUIProvider
> uiProvider, StringBuilder sbTemp)    at
> Microsoft.Crm.Core.Application.WebServices.AppGridWebServiceHandler.Refresh(String
> gridXml, StringBuilder sbXml, StringBuilder sbHtml, Boolean
> returnJsonData)    at
> Microsoft.Crm.Core.Application.WebServices.AppGridWebServiceHandler.ProcessRequestInternal(HttpContext
> context)
>
> [XmlException: System.InvalidCastException: Unable to cast object of
> type 'System.DBNull' to type 'Microsoft.Xrm.Sdk.OptionSetValue'.    at
> Microsoft.Crm.Application.Controls.Grid.UI.PropertyTemplatePropertiesConfigurationColumn.BindData(WebControl
> parentControl, IRowDataSource rowData)    at
> System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding)    at
> System.Web.UI.Control.DataBindChildren()    at
> System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding)    at
> System.Web.UI.WebControls.GridView.CreateRow(Int32 rowIndex, Int32
> dataSourceIndex, DataControlRowType rowType, DataControlRowState
> rowState, Boolean dataBind, Object dataItem, DataControlField[]
> fields, TableRowCollection rows, PagedDataSource pagedDataSource)  
> at System.Web.UI.WebControls.GridView.CreateChildControls(IEnumerable
> dataSource, Boolean dataBinding)    at
> System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable
> data)    at
> System.Web.UI.WebControls.GridView.PerformDataBinding(IEnumerable
> data)    at
> System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable
> data)    at System.Web.UI.WebControls.DataBoundControl.PerformSelect()
> at
> Microsoft.Crm.Application.Controls.Grid.UI.LayoutProviderGridList.RenderGridData(HtmlTextWriter
> output)    at
> Microsoft.Crm.Application.Controls.Grid.UI.LayoutProvider.Render(HtmlTextWriter
> output)    at
> Microsoft.Crm.Application.Controls.GridUIProvider.Render(HtmlTextWriter
> output)    at
> Microsoft.Crm.Core.Application.WebServices.AppGridWebServiceHandler.GetRefreshResponseHtml(IGridUIProvider
> uiProvider, StringBuilder sbTemp)    at
> Microsoft.Crm.Core.Application.WebServices.AppGridWebServiceHandler.Refresh(String
> gridXml, StringBuilder sbXml, StringBuilder sbHtml, Boolean
> returnJsonData)    at
> Microsoft.Crm.Core.Application.WebServices.AppGridWebServiceHandler.ProcessRequestInternal(HttpContext
> context)]    at
> Microsoft.Crm.Core.Application.WebServices.AppGridWebServiceHandler.ProcessRequestInternal(HttpContext
> context)    at
> System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
> at System.Web.HttpApplication.ExecuteStep(IExecutionStep step,
> Boolean& completedSynchronously)


I am completely baffled, and help you guys can offer would be tremendously appreciated. The most troubling thing about this is that none of the fields I'm fetching are an option set, so what's going on here? Thank you.

-Josh


Viewing all articles
Browse latest Browse all 79901

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>