Wednesday, July 1, 2015

Report Parameter Error(the value expression for the query parameter refers to non-existing report parameter . letters in the names of parameters must use the correct case)

 I use the @Region in the dataset query, then modify the parameter name from Region to region, then modify the @Region to @region in the dataset query. When we render the report, it throws an error message that “The Value expression for the query parameter '@region' refers to a non-existing report parameter 'Region'. Letters and names of parameters must use the correct case.” But we couldn’t find anything about Region in the Report Data tab.

the query parameter @region still use the =Parameters! Region.Value as value in the XML file. Even after removing them from the Data tab, the fields might still be in the and section.  Right-click the report in the Solution Explorer and go to "View Code" and double-check if Region is still present in those sections of the XML.
What's more, the issue may be caused by the cache. Please try to delete the reportname.rdl.data file in the report project folder before preview the report.

Monday, June 29, 2015

Principal user is missing prvReadComplexControl privilege

Recently we have upgraded CRM 2011 to CRM 2013 and we were getting generic errors "Insufficient permissions" when we open few entity forms in CRM

On debugging after switching on CRM trace logs we have found that the user is missing some privilages. Below is the execption we got.

>UNEXPECTED: no fault?
[2015-06-29 01:21:28.151] Process: w3wp |Organization:00000000-0000-0000-0000-000000000000 |Thread:  346 |Category: Platform |User: 00000000-0000-0000-0000-000000000000 |Level: Error |ReqId: 33a6e86d-6e32-48b9-8065-d3aa8f576c42 | ExceptionConverter.ConvertMessageAndErrorCode  ilOffset = 0x23B
>System.Web.HttpException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #41EB8FD7: System.Web.HttpException (0x80004005): Error executing child request for /CRMUPGV5/_forms/read/page.aspx. ---> System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> Microsoft.Crm.CrmException: Principal user (Id=40f2886d-c8da-e111-80f0-005056ae010b, type=8) is missing prvReadComplexControl privilege (Id=a4736385-9763-4a64-a44b-cd5933edc631)
>   at Microsoft.Crm.Application.Platform.ServiceCommands.PlatformCommand.XrmExecuteInternal()
>   at Microsoft.Crm.Application.Platform.ServiceCommands.RetrieveCommand.Execute()
>   at Microsoft.Crm.Caching.ComplexControlLoader.LoadCacheData(Guid key, IOrganizationContext context)
>   at Microsoft.Crm.Caching.CrmMultiOrgCacheBase`2.CreateEntry(TKey key, IOrganizationContext context)
>   at Microsoft.Crm.Caching.CrmMultiOrgCacheBase`2.LookupEntry(TKey key, IOrganizationContext context)
>   at Microsoft.Crm.Application.Components.Sdk.InlineEditControls.Web.CompositionLinkControl.GetFlyOutDescriptor()
>   at Microsoft.Crm.Application.Components.Sdk.InlineEditControls.Web.LinkControl.GetRequiredColumns(Int32 entityTypeCode)
>   at Microsoft.Crm.Application.Forms.CompositeControlVisitor.HandleColumnProvider(Control control, FormDescriptor formDescriptor)
>   at Microsoft.Crm.Application.InlineEdit.Mediators.FormMediator.AddControlProperties(ICrmControl crmControl, ControlDescriptor controlDescriptor)
>   at Microsoft.Crm.Application.InlineEdit.Mediators.FormMediator.ProcessControlHierarchy(Action`2 controlHandler)
>   at Microsoft.Crm.Application.InlineEdit.Mediators.FormMediator.GetInstance(FormFactor formFactor, FormDescriptor descriptor, Guid processId, Int64 processVersionNumber, IOrganizationContext organizationContext)
>   at Microsoft.Crm.Application.InlineEdit.Mediators.FormMediator.GetInstance(FormFactor formFactor, Guid formId, Guid processId, Int64 processVersionNumber, IOrganizationContext organizationContext)
>   at Microsoft.Crm.Application.InlineEdit.ReadFormDataBuilder..ctor(String recordId, String entityTypeCode, Guid formId, FormFactor formFactor)
>   at Microsoft.Crm.Application.Pages.Common.ReadFormPage.PopulateFormDescriptorAndDataBuilder()
>   at Microsoft.Crm.Application.Pages.Common.ReadFormPage.OnPreInit()
>   at Microsoft.Crm.Application.Controls.AppUIPage.OnInit(EventArgs e)
>   at Microsoft.Crm.Application.Controls.AppPage.OnInit(EventArgs e)
>   at System.Web.UI.Control.InitRecursive(Control namingContainer)
>   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
>   at System.Web.UI.Page.HandleError(Exception e)
>   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
>   at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
>   at System.Web.UI.Page.ProcessRequest()
>   at System.Web.UI.Page.ProcessRequest(HttpContext context)
>   at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride)
>   at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride)
>   at System.Web.HttpServerUtility.Execute(String path, TextWriter writer, Boolean preserveForm)
>   at System.Web.HttpServerUtility.Transfer(String path)
>   at System.Web.UI.Control.PreRenderRecursiveInternal()
>   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
>   at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
>   at System.Web.UI.Page.ProcessRequest()
>   at System.Web.UI.Page.ProcessRequest(HttpContext context)
>   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
>   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)



The error seems to talk about some complex control in CRM to which the user does not have read privilege. Perplexed that you never heard of any ComplexControl entity in CRM?

However a little bit of search in SDK regarding this privilege and this is what I got from the SDK.
ComplexControl entity is for internal use only. However, users need read access to this entity in order to see the updated experience for lead and opportunity forms.
Still can’t find the complexcontrol entity? No worries. Open the security roles of the user who is getting this error.
Go to Customizations tab and search for the Process Configuration entity and assign the privileges for the security role. Check the below screenshot.




The SDK also clearly states out that this privilege is for Process Configuration entity.


Hope this helps someone who face similar problems!!!


Thursday, June 18, 2015

CRM 2011 Quick Find Search results grid not showing header data

We have faced an issue with quick search not showing header data. fields are visible but data is not visible in the grid.

We have a Quote OOB entity and Quote Part which is a custom entity and has 1:N relationship with Quote

In the main navigation we have the quote part entity displayed under sales.

When we initially open the quote part entity grid it shows all the fields of quote and quote part with all the data visible.

Once i search with one of the quote part field it shows the NO OF RESULTS correctly but it returns the Quote related fileds empty.

After log of research and trail and error method we have found that the Quick find configuration has a problem.

No Fields were selected in Quote part quick find (Find Fields)  After we select the few fields in the FIND COLUMNS it started returning the data for the Quote attributes. Weird but true.

This is no where documented in SDK. So thought it will be helpful for anyone else who face the same issue

Here are the screenshots showing the error






Tuesday, June 16, 2015

Reload Form in CRM 2013

CRM 2013 form will not reload the entire form after saving the record this is by design.
 so as a work around is to use "Xrm.Utility.openEntityForm" provided in SDK which is supported in all browsers.

Modified on Field in CRM will always be updated on CREATE and UPDATE of the record so we will register a function on Change of Modified on field.

function modifiedon_onChange() {
    reloadFormAfterSave();
}

function reloadFormAfterSave() {
    setTimeout(function() {
        Xrm.Utility.openEntityForm(Xrm.Page.data.entity.getEntityName(), Xrm.Page.data.entity.getId());
    }, 500);

}



Wednesday, April 1, 2015

Fetch Xml to Get Workflow Id by Name

 <fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>  
  <entity name='workflow'>  
   <attribute name='workflowid' />  
   <attribute name='name' />  
   <attribute name='category' />  
   <attribute name='primaryentity' />  
   <attribute name='statecode' />  
   <attribute name='createdon' />  
   <attribute name='ownerid' />  
   <attribute name='owningbusinessunit' />  
   <attribute name='type' />  
   <order attribute='name' descending='false' />  
   <filter type='and'>  
    <condition attribute='type' operator='eq' value='1' />  
    <filter type='or'>  
     <condition attribute='category' operator='eq' value='0' />  
     <filter type='and'>  
      <condition attribute='category' operator='eq' value='1' />  
      <condition attribute='languagecode' operator='eq-userlanguage' />  
     </filter>  
    </filter>  
    <condition attribute='name' operator='eq' value='WORKFLOW NAME' />  
   </filter>  
  </entity>  
 </fetch>  

Thursday, March 5, 2015

New Line in SSRS Text box

=Fields!AddressLine1 + VBCRLF + Fields!AddressLine2 + VBCRLF + Fields!AddressLine3 

OP:
 Address1
 Address2
 Address3


Note: If VBCRLF is used first or last part the expression, it has no impact on result. If you want a line in the first or last, then use one more extra VBCRLF.

Thursday, February 26, 2015

Switch HTTP request object for browser compatability

 function GetRequestObject() {  
   if (window.XMLHttpRequest) {  
     return new window.XMLHttpRequest;  
   } else {  
     try {  
       return new ActiveXObject("MSXML2.XMLHTTP.3.0");  
     }  
     catch (ex) {  
       return null;  
     }  
   }  
 }