Search This Blog

Showing posts with label CRM Dynamics Error. Show all posts
Showing posts with label CRM Dynamics Error. Show all posts

Tuesday, March 5, 2019

In order to access security critical code, this assembly must be fully trusted.Assembly 'System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' is a conditionally APTCA assembly which is not enabled in the current AppDomain. To enable this assembly to be used by partial trust or security transparent code, please add assembly name 'System.Web.Extensions

While using JavaScriptSerializer class (referencing System.Web.Extension dll in the plugin project) the below error thrown at the run time.

In order to access security critical code, this assembly must be fully trusted.
                     Assembly 'System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' is a conditionally APTCA assembly which is not enabled in the current AppDomain. To enable this assembly to be used by partial trust or security transparent code, please add assembly name 'System.Web.Extensions

Solution:


  JavaScriptSerializer jss = new JavaScriptSerializer();  
           dynamic obj = jss.Deserialize<dynamic>(responsebody);  
           string token = obj["access_token"];  

 Instead of Above Code:
 public class AccessToken
    {
        public string access_token { get; set; }
    } 
using (var memorystream = new MemoryStream())  
           {  
             var deserializer = new DataContractJsonSerializer(typeof(AccessToken));  
             StreamWriter writer = new StreamWriter(memorystream);  
             writer.Write(responsebody);  
             writer.Flush();  
             memorystream.Position = 0;  
             AccessToken deserializedResult = (AccessToken)deserializer.ReadObject(memorystream);  
             string token1 = deserializedResult.access_token;  
           }   

Wednesday, April 4, 2018

Couldn’t import a Custom Control Default Config for ObjectTypeCode 10022 because its 'customcontroldefaultconfigid' already exists on the system.

Couldn’t import a Custom Control Default Config for ObjectTypeCode 10022 because its 'customcontroldefaultconfigid' already exists on the system.

Solution:

Solution:1

  • Extract the solution file and open the customization.xml file 
  • Remove the content/subnode tag in the "CustomControlDefaultConfigs" node <CustomControlDefaultConfigs> </CustomControlDefaultConfigs>
  • save the file and zip it and import again in the CRM.
Solution:2

  • Use the script below to find the oldest duplicated records on CustomControlDefaultConfigBase
select PrimaryEntityTypeCode, min(CreatedOn) oldest from CustomControlDefaultConfigBase
where PrimaryEntityTypeCode in (select PrimaryEntityTypeCode from CustomControlDefaultConfigBase group by PrimaryEntityTypeCode having count(1) >1) group by
PrimaryEntityTypeCode

  • Delete these records and export the solution again (managed or unmanaged)
  • Try to import it on the new environment

Wednesday, December 20, 2017

Incoming Status: Failure - The specified object was not found in the store. Verify that the specified user credentials have Receive permission on the target mailbox. Error: ErrorItemNotFound

Incoming Status: Failure - The specified object was not found in the store. Verify that the specified user credentials have Receive permission on the target mailbox. Error: ErrorItemNotFound

You have to provide the Full Access to another mailbox for email router configured user For example, If your email router is configured/run as exhange admin then you have to provide other use r mail box full access permission.

Exchange online





Add email router configured user to the full access grid.

Incoming profiles support the following access credentials:
  • Local System Account. This option requires a machine trust between the computer where the Email Router is running and the computer where Microsoft Exchange Server is running. For incoming profiles, this option is available only for Exchange Server (not for Exchange Online or other POP3 compliant email servers).
  • User specified. This option is available only in the on-premises version of the product. This option is available for all email server types, protocols, and authentication types.
    This option requires that each user enter a user name and password in the Set Personal Options dialog box (available in the Workplacesection of the Microsoft Dynamics CRM web client). This enables the Email Router to monitor mailboxes by using each user's access credentials. When a user changes a domain password -- for example, when it expires -- the user must update the password in Microsoft Dynamics CRM so that the Email Router can continue to monitor the mailbox. This option is available for Exchange Server, Exchange Online and other POP3 compliant email servers.
  • Other specified. Select this option if you want the Email Router to authenticate by using the credentials of a specified user. This option is available for all email server types, protocols, and authentication types. The specified user must have full access to all the mailboxes that the incoming profile will serve. To specify multiple sets of access credentials, you must create a separate configuration profile for each specified user.
Outgoing profiles support the following access credentials. For more information, see the Email Router Configuration Manager Help.
  • Local System Account. Select this option if you select SMTP as the email server type and you want to authenticate by using the local system account of the computer where the Email Router is running. This option requires a machine trust between the computer where the Email Router is running and the computer where the Exchange Server is running. For more information, see “Securing Exchange Server and Outlook” in Operating system and platform technology security considerations for Microsoft Dynamics 365. If you select this option, either the Email Router must be installed on the same server as the Microsoft Dynamics CRM server, or the Email Router computer name must have been entered during Microsoft Dynamics CRM Server Setup. This option is available only when you select SMTP as the email server type, and Windows Authentication or Anonymous as the authentication type.
  • User Specified.
    This option is available in the on-premises and Service Provider editions of Microsoft Dynamics CRM, and when you are using Exchange Online as the Exchange Server Type.
    Select this option if you want the Email Router to authenticate by using an individual user account or a mailbox.
  • Other Specified. This option enables the administrator to configure the Email Router to send email messages on each user's behalf by using the access credentials of a specified user account. The specified user must have full access to all the mailboxes that the incoming profile will serve. To specify multiple sets of access credentials, you must create a separate configuration profile for each specified user. This option is not available if you select SMTP as the email server type and Anonymous as the authentication type.



Wednesday, April 19, 2017

Error occur on update using CRM web API: The requested resource does not support http method_other (405 method not allowed )

Error occur on update using CRM web API: The requested resource does not support http method_other (405 method not allowed )

When i update the single property using patch on CRM web API. The above error so I use put to update the singe property.

E.g:

var objSalesOrder= new Object();
objSalesOrder.customerRequest=true;


When i update the sales order using patch the above error occured.

Update a single property value
If you want to update a single property then use the HTTP PUT verb. And append the property name with the Url

Request

PUT [organization URI]/api/data/v8.0/accounts(00000000-0000-0000-0000-000000000001)/name HTTP/1.1
Content-Type: application/json
OData-MaxVersion: 4.0
OData-Version: 4.0
{"value": "Updated Sample Account Name"}

Response

HTTP/1.1 204 No Content
OData-Version: 4.0

Monday, April 17, 2017

CRM Unable to login. In the event viewer,The same client browser session has made '6' requests in the last '2' seconds

The CRM server URL as a trusted site in IE, but not the ADFS URL. After trying to fix the issue I found this knowledge base article: http://support.microsoft.com/kb/2514318 and after adding the domain which covers CRM and ADFS to the IE trusted site list (https://*.domain.com.au) 

I was able to login.

Monday, September 26, 2016

Optionset name is already exist error occur while import solution in CRM

Error Description:
Optionset name is already exist error occur while import solution in CRM

Cause:
The schema name of the source and target environment must be same.

Target system Schema Name Destination system Schema Name
new_TestData new_testdata

Even though difference in the capitalisation, it won't import schema name must be same(name should be same in the  both environment)

Solutions:
 There are two solution.

  • Delete the column name in the destination and import the solution.

          Cons:
             If you delete the column in the destination, the data would loss.

  • Update the attribute table in the destination in the SQL as 

          "update Attribute set PhysicalName='new_TestData' where name ='new_testdata'"
          Cons:
            It works only in on-premise

Friday, August 12, 2016

The security timestamp is invalid because its creation time is in the future – Error CRM


 Error:
The security timestamp is invalid because its creation time is in the future – Error CRM

Reason:
  • There was difference in date and time settings between CRM Front end server and CRM DB Server.
  • There was difference in date and time settings between CRM server and plugin server.
  • There was difference in date and time setting between CRM server and AX connector or other integration tool.
Solution:
The Date and time must be same in the both server

Tuesday, August 2, 2016

Operator 'eq' incompatible with operand types 'System.Nullable`1[[System.DateTime

Operator 'eq' incompatible with operand types 'System.Nullable`1[[System.DateTime, Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]' and 'System.String' at position 25.

In the OData filter you have to pass "datetime" (pass data type)

var strFilter ="$filter=kti_DateCheck eq datetime'2016-08-02T19:05:37Z'"

Monday, June 20, 2016

The provided uri did not return any Service Endpoints! {0}" Data[1] in CRM plugin

Error:
System.InvalidOperationException: Data[0] = "The provided uri did not return any Service Endpoints! {0}" Data[1] = "" at 
Microsoft.Xrm.Sdk.Client.ServiceConfiguration`1..ctor(Uri serviceUri, Boolean checkForSecondary) at 
Microsoft.Xrm.Sdk.Client.OrganizationServiceConfiguration..ctor(Uri serviceUri) at 
Microsoft.Xrm.Sdk.Client.ServiceConfigurationFactory.CreateConfiguration[TService](Uri serviceUri) at Microsoft.Xrm.Sdk.Client.ServiceProxy`1..ctor(Uri uri, Uri
 homeRealmUri, ClientCredentials clientCredentials, ClientCredentials deviceCredentials) at RMSystem.MyService.SaveAdditionalRef(clsRegistration reg, ResultSet& 
Cause:
This error is due to memory shortness on the CRM server. CRM automatically shuts down its exposed webservice interface when resources get scarce.

Solution:
There are three steps to solve this issue.


  • Open a connection to the CRM server and open the IIS manager. In here, navigate to the application pools, find the CRMAppPool, right-click it and click Recycle and try again to test app.
  • type iisreset in a command prompt on the server which hosts the CRM website and try again to test app.
  • Reset the Asynchronous processing service(run->type service.msc, Reset Microsoft dynamics CRM Asynchronous processing service) and try again to test app.




Tuesday, June 14, 2016

The report cannot be displayed. (rsprocessingaborted) in CRM 2011(Part-1)




To find out the actual error, go to the SQL Reporting Services Server, and look at the log file in

C:\Program Files\Microsoft SQL Server\MSRS11.MSSQLSERVER\Reporting Services\LogFiles.

To resolve this issue I had to follow these steps

Start SQL Server Management Studio
Expand Security, then expand Logins or select the CRM database and click securitiy and click logins/users
Double click PrivReporting Group,
Check db_owner and CRMReaderRole




or
May be this issue because of SPN

SPN:
Put simply, an SPN (Service Principal Name) mapping allows a service on a particular server to be associated with an account responsible for the management of the service, thereby permitting mutualKerberos Authentication. To use mutual Kerberos authentication, the Windows security layer must be able to determine the account that a service is using.

Simple explanation:
CRM can have a database server separate to the Application Server (where IIS is hosted). For security purposes, it is advisable to run CRM as a service account which is also existed on Domain.
Similarly, it is advisable to run SQL server on the Database server in a separate service account on domain.
So, when SPN is not configured Application server is not able to authenticate SQL server as both are running under different accounts.
SPN creates a mapping so that Authentication can happen and thus reports start working most times after this is configured correctly.
Thanks to Deepesh Somani for sharing good explanation of SPN.

The report cannot be displayed. (rsprocessingaborted) in CRM 2011(Part-2)

A best practice is to install CRM using service accounts.

 Most administrators will do the same for SQL Server.  Many of the warnings about SPN’s during the install are igorned users. Many DBA’s will change the SQL service accounts after installation which will also cause issues.

CRM 2011 offers a new service called the Sandbox processing service. Failure to set the special SPN for this service while trying to run custom reports created with the report wizard will result in RS failure message.

SPN
A common configuration step when establishing a Kerberos authentication method is the use of a Service Principal Name, or SPN, to identify a specific service. This article shows you how to specify a user or computer account to be identified with that specific service by using the SetSPN utility.

An SPN is a reference to a specific service, for example, an instance of SQL or a web application run by IIS. Since SPNs are specific, they reference not only what the service is (such as an SQL server), but also which hostname runs the instance and on which port it’s running (however, you don’t have to specify the port if running on default ports).

Syntax:
-a    Add an entry to an account (explicitly)
-s    Add an entry to an account (only after checking for duplicates first)
-d    Delete an entry from an account
-x    Search the domain for duplicate SPNs

-q    Query the domain for a specific SPN

ext, check the SPN for the CRM server so that it has HTTP using the following command:
setspn -L ( crm service account) 
Look for http/servername and http/servername.FQDN you will need both.
To set them if missing:
setspn -A http/crmservername domainname\crmservice account
setspn -A http/crmservername.fqdn.com domainname\crmservice account

To view use the setspn -L with the service account name to see http has been set. (See screenshot below)

Eg:
CRM service account:       CRM_APP_SVC_TEST
domainname:                      iff.local
crmservername :                CRMDEV.iff.local
crmservername.fqdn.com:CRMDEV

setspn -l CRM_APP_SVC_TEST

setspn -a http/CRMDEV.iff.local iff.local\CRM_APP_SVC_TEST

setspn -a http/CRMDEV iff.local\CRM_APP_SVC_TEST

Now, on to the secret spn for the sandbox service..

setpsn -A MSCRMSandboxService domainname\crmsandbox service account

Once that has been completed on the CRM server, now head over to the SQL Server and check the service accounts for SQL. Let’s assume they are running under a SQL Service Account. IF the SQL service accounts were specified during the original install, the SPNs were created automatically.

Thursday, May 12, 2016

Database cannot be started in this edition of SQL Server because it contains a partition function 'AuditPFN'


Today I faced this problem when trying to restore a Dynamics CRM  database from a SQL Server  Enterprise Edition to a SQL Server  Developer Edition or Standard edition.

It got me crazy as I did not created any partition on the original DB and this problem didn’t allow to me to restore the DB

Cause:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

Database 'Org_MSCRM' cannot be started in this edition of SQL Server because it contains a partition function 'AuditPFN'. Only Enterprise edition of SQL Server supports partitioning. Database 'Org_MSCRM' cannot be started because some of the database functionality is not available in the current edition of SQL Server.

Solution:
IF EXISTS (SELECT name FROM sys.partition_schemes WHERE name='AuditPScheme')
BEGIN
SELECT
  CASE WHEN ind.type != 1
   THEN
    'DROP INDEX [dbo].[AuditBase].' + QUOTENAME(ind.name) + ' '
   ELSE ' '
  END +
  'CREATE ' + CASE is_unique WHEN 1 THEN 'UNIQUE ' ELSE '' END  +
  ind.type_desc + ' INDEX ' + QUOTENAME(ind.name  COLLATE SQL_Latin1_General_CP1_CI_AS )  + ' ON [dbo].' +  QUOTENAME(OBJECT_NAME(object_id)) + ' (' +
 
  REVERSE(SUBSTRING(REVERSE((
   SELECT name + CASE WHEN sc.is_descending_key = 1 THEN ' DESC' ELSE ' ASC' END + ','
   FROM
    sys.index_columns sc
    JOIN sys.columns c ON sc.object_id = c.object_id AND sc.column_id = c.column_id
   WHERE
    OBJECT_NAME(sc.object_id) = 'AuditBase' AND
    sc.object_id = ind.object_id AND
    sc.index_id = ind.index_id
   ORDER BY index_column_id ASC
   FOR XML PATH('')
        )), 2, 8000)) + ')' +
  CASE WHEN ind.type = 1
   THEN
    ' WITH (DROP_EXISTING = ON) ON [PRIMARY]'
   ELSE
    ' '
  END  as Script
INTO #indexesScript
FROM sys.indexes ind
JOIN sys.partition_schemes ps on ind.data_space_id=ps.data_space_id
WHERE
  OBJECT_NAME(object_id) = 'AuditBase'
  AND ps.name = 'AuditPScheme'
  AND is_unique_constraint = 0
SELECT * FROM #indexesScript
 
DECLARE @recreateScript nvarchar(max)
DECLARE indScript CURSOR FOR
SELECT Script FROM #indexesScript
OPEN indScript
FETCH NEXT FROM indScript INTO @recreateScript
 
WHILE @@FETCH_STATUS = 0  
BEGIN  
  BEGIN TRANSACTION t1
  Execute sp_executesql @recreateScript
 
  IF @@ERROR > 0
  BEGIN
   ROLLBACK TRAN t1
   declare @message varchar(max)
   set @message = 'Audit history recreate index failed. SQL: ' + @recreateScript
      RAISERROR (@message, 10,1)
  END
  ELSE
  BEGIN
   COMMIT TRAN
  END
  FETCH NEXT FROM indScript INTO @recreateScript  
END  
DROP PARTITION SCHEME AuditPScheme
DROP PARTITION FUNCTION AuditPFN
 
CLOSE indScript  
DEALLOCATE indScript
DROP TABLE #indexesScript
END

Operator '+' is not defined for string SSRS

In the concatenation expression, one of the item value is not string. You have to convert to string and concatenate it.

Object address not found on party or party is marked as non-emailable

Usually this error occur when you want to send mail to Account or Contact or User from workflow or plugin


 Account or Contact

  • Check DonotEmail or DonotBulkemail is must set to "allow"


User 
You have to check the primary email field is filled in the user entity.

Dynamics CRM 2013 Microsoft.Crm.Reporting.RdlHelper error when attempting to preview a CRM report within SQL Data Tools

If you have setup your CRM 2013 Report Authoring Environment using the SQL Data Tools (Visual Studio 2010) and the CRM 2013 Report Authoring Extensions – when modifying Out of Box CRM Reports or Reports created by the CRM Report Wizard, you may encounter the following error when attempting to preview within the SQL Data Tools:

Error while loading code module: ‘Microsoft.Crm.Reporting.RdlHelper, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35. Details: Could not load file or assembly ‘Microsoft.Crm.Reporting.RdlHelper, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 or one of its dependencies.

The most common reason for this error is that the report is referencing version 5.0.0.0 of Microsoft.Crm.Reporting.RdlHelper and your Report Authoring Environment actually utilises version 6.0.0.0

To overcome this issue, you can simply do the following:

Make sure your focus is on the Report Layout

  • Go to the Report menu on the toolbar and select Report Properties 

  • Select the References section and there you should see the reference to Microsoft.Crm.Reporting.RdlHelper 
  • Edit the version number to be 6.0.0.0 (instead of 5.0.0.0) 

  • Press OK

Thursday, April 28, 2016

Disabled "Send Error Report" in microsoft dynamics CRM has an encourtered problem

Disabled "Send Error Report" in microsoft dynamics CRM has an encourtered problem

In CRM Settings -> Administrator->Privacy Preferences




Tuesday, March 22, 2016

Appointments, contacts, and tasks can't be synchronized because the email address of the mailbox is configured with another Microsoft Dynamics CRM organization. The best practice is to overwrite the configuration when you test and enable the mailbox in your primary organization. Also, change the synchronization method for your mailbox in non-primary organizations to None.

To change the primary synchronization organization and overwrite the setting stored in Exchange, click: Settings > Email Configuration > Mailbox > open a mailbox > Test & Enable Mailbox > select Sync items with Exchange from this CRM Organization only, even if Exchanges was set to sync with a different Organization. This will allow server-side synchronization to work for this CRM instance but the other instance would no longer work for synching that mailbox through server-side synchronization. To change the synchronization method for Appointments, Contacts, and Tasks, click: Settings > Email Configuration > Mailbox > open a mailbox > select None for Appointments, Contacts, and Tasks.


Tuesday, January 12, 2016

The record cannot be deleted because it is associated with another record

The record cannot be deleted because it is associated with another record

Whenever you delete the record in the CRM the above error occur.

Solution:
Example:
If you delete the account in CRM.


You have to open the record and delete all the data in the subgrid of that record that means an account has "1:N" relationship  items, those items has to be delete first.

To easily find the associated record, try to delete the account in the sql it throws error as reference constraint error in which it says relationship name. In which you can easily find
in which entity an account is associated with it.
Here credit card entity (custom entity) is linked with that account. So delete that credit card first and then delete the account. It will successfully deleted.



Monday, January 4, 2016

Plugin error:The caller was not authenticated by the service or The request for security token could not be satisfied because authentication failed

Error : The caller was not authenticated by the service.
Stack Trace : Server stack trace:
   at System.ServiceModel.Security.IssuanceTokenProviderBase`1.DoNegotiation(TimeSpan timeout)
   at System.ServiceModel.Security.SspiNegotiationTokenProvider.OnOpen(TimeSpan timeout)

Error : The request for security token could not be satisfied because authentication failed.
Stack Trace : at System.ServiceModel.Security.SecurityUtils.ThrowIfNegotiationFault(Message message, EndpointAddress target)

Solution:
On-Premises

  • Check your plugin tool opened system timing and CRM server timing must be same or five mins different.
  • Try your username as domain\username or only username.



Unable to get name from EntityReference

EntityReference name property value is null in plugin.

This property is not automatically populated unless the EntityReference object has been retrieved from the server.