Search This Blog

Thursday, July 5, 2018

USD Package Deployer unable to connect with Dynamics 365 (Online)

USD Package Deployer unable to connect with Dynamics 365 (Online)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319]

and similarly

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319]

Visit these keys in the registry editor, right click in the right pane, click on 'New >', add dword key as "SchUseStrongCrypto"=dword:00000001

For .net 4.5 and below, strong crypto is disabled by default and only SSL 3.0 and TLS 1.0 will be used for secure connections. By setting these reg-keys TLS 1.0, TLS 1.1 and TLS 1.2 will be used.

Refer:
https://blogs.msdn.microsoft.com/usd/2017/10/20/unified-service-desk-and-tls-1-2-mandate-for-dynamics-365-online/

Wednesday, April 4, 2018

Get all week based on month and year using SQL Server


Get all week based on month and year using SQL Server:
DECLARE @Year char(4), @iValue TINYINT, @Month tinyint
--//Populate your parameter values
 SET @Year = '2018';

select * into #temptest from (

SELECT DATEPART(wk,DATEADD(wk,t2.number,@Year)) as Weeknumb,( SELECT DATENAME(month, DATEADD(month,  month(DATEADD(wk,t2.number,@Year + '/01/01')), -1 ))) AS Month
FROM master..spt_values t2
WHERE t2.type = 'P'
AND t2.number <= 255
AND YEAR(DATEADD(wk,t2.number,@Year))=@Year) as T


select 'Week-' + convert(varchar(50), ROW_NUMBER() OVER( ORDER BY Weeknumb)) as Week, 
Weeknumb,Month  from #temptest where Month='April'


Get all week number by given year using SQL Server

Get all week number by given year using SQL Server


DECLARE @Year char(4), @iValue TINYINT, @Month tinyint

--//Populate your parameter values

 SET @Year = '2018';

SELECT DATEPART(wk,DATEADD(wk,t2.number,@Year)) as Weeknumb,( SELECT DATENAME(month, DATEADD(month,  month(DATEADD(wk,t2.number,@Year + '/01/01')), -1 ))) AS Month

FROM master..spt_values t2

WHERE t2.type = 'P'

AND t2.number <= 255

AND YEAR(DATEADD(wk,t2.number,@Year))=@Year

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

Friday, January 19, 2018

Tuesday, January 2, 2018

Create a child record by copying mapping fields data from Parent – Using CRM SDK

Create a child record by copying mapping fields data from Parent – Using CRM SDK


InitializeFromRequest initialize = new InitializeFromRequest();

// Set the target entity (i.e.,Contact)
initialize.TargetEntityName = “contact”;

// Create the EntityMoniker of Source (i.e.,Account)
initialize.EntityMoniker = new EntityReference(“account”, new Guid(“D4CBEE74-B5E3-E611-8109-C4346BDD8041”));

// Execute the request
InitializeFromResponse initialized = (InitializeFromResponse)orgService.Execute(initialize);

// Read Intitialized entity (i.e.,Contact with copied attributes from Account)
if (initialized.Entity != null)
{
// Get entContact from the response
Entity entContact = initialized.Entity;

// Set the additional attributes of the Contact
entContact.Attributes.Add(“firstname”, “Rajeev”);
entContact.Attributes.Add(“lastname”, “Pentyala”);

// Create a new contact
orgService.Create(entContact);

Thanks to Rajeev, please find URL below to the original post