Skip to main content

Posts

Showing posts from 2014

How to create new (missing) columns for entities in your Data Export Service Azure SQL database

CRM 2013: Condition for attribute 'template.templatetypecode': null is not a valid value for an attribute. Use 'Null' or 'NotNull' conditions instead.

Lately I was fighting with an issue that on some CRM instances the default email templates view in the Templates section of CRM 2013 did not show up and only showed me this error message:

Condition for attribute 'template.templatetypecode': null is not a valid value for an attribute. Use 'Null' or 'NotNull' conditions instead.

After searching for a long time I found the simple bug. Throught migration from 4.0 to CRM 2013 over CRM 2011 and changing customizations it seemed that CRM got messed up or was not able to handle the changes very well.

The issue here was to go to the views section of the Email Templates entity and to make sure there is only ONE default public view. If there are two you will get strange system behavior.

I fixed this problem through updating the isdefault property of the second unwanted default view in the SavedQueryBase data table. The id of this view  you can retrieve by openen the view and by copying it out from the URL.

Én voilá the pr…

CRM 2013: Translation import error: The value passed for ConditionOperator.In is empty

This week a very evil error drove me nuts.

In CRM 2013 I tried to import a translation file into an organization.
It always ended up with this error message: The value passed for ConditionOperator.In is empty

I was like what in the world does this message mean.
If an old school approach in splitting up the file into serveral smaller Import files I finally figured out that the following lines in the "Localized Labels" sheet caused this trouble:

RibbonCustomization11a15acc-61f1-e311-93f9-00505681252eMscrm.Isv.orb_input.HomepageGrid.Group0.Control0.LocLabelRibbonCustomization11a15acc-61f1-e311-93f9-00505681252eMscrm.Isv.orb_input.HomepageGrid.Group0.Control0.ToolTip.LocLabelRibbonCustomization11a15acc-61f1-e311-93f9-00505681252eMscrm.Isv.orb_input.SubGrid.Group0.Control0.LocLabelRibbonCustomization11a15acc-61f1-e311-93f9-00505681252eMscrm.Isv.orb_input.SubGrid.Group0.Control0.ToolTip.LocLabel
To resolve this problem delete the ribbon customization rows from the translation file …

CRM 4.0: Custom Report -> Incorrect syntax near ...

The customer had an issue with a custom CRM 4.0 report.
It seems this error occured now because the SQL Server run with 2008 instead of 2005 or the report indeed had a bug. (Thanks to SQL Profiler, I found it.)

The customer had this error coming up:
Query execution failed for dataset '....'.
Incorrect syntax near '20140913'

After analysing the report XML I figured out the problem:

DECLARE @SQL AS NVARCHAR(MAX)
SET @SQL = '
SELECT
CRMAF_FilteredAccount.accountid,
CRMAF_FilteredContact.firstname,
CRMAF_FilteredContact.jobtitle,
CRMAF_FilteredContact.lastname,
CRMAF_FilteredContact.telephone1
FROM (' + @CRM_FilteredAccount + ') AS CRMAF_FilteredAccount INNER JOIN FilteredContact AS CRMAF_FilteredContact
ON CRMAF_FilteredAccount.accountid = CRMAF_FilteredContact.parentcustomerid
ORDER BY CRMAF_FilteredContact.lastname'
EXEC(@SQL)

The red must be replaced with:

DECLARE @SQL AS NVARCHAR(MAX)
SET @SQL = '
SELECT
CRMAF_FilteredAccount.accountid,
CRMAF_Filte…

SharePoint 2013: Upload in DocLib fails with 404 file not found via GUI or REST call

Via browser or my REST Client app I was not able to upload files with sizes greater than 300KB.
After some research I found out that some coworder mistakenly changed the web.config in a wrong manner. He set the value maxallowedcontentlength for the requestfiltering section to around 300KB.
Luckily, SharePoint Health is smart to find this kind of errors.

Resetting the line in the web.config helped:
The requestLimits element has a maxAllowedContentLength attribute and its value is set to 2147483647. => according to Microsoft MSDN.

SharePoint 2013: Experiences with custom REST services for SharePoint (DateTime and Guid Types)

Recently I tried to get some custom REST Services for SharePoint working but had the Problem that my DateTime and Guid properties or parameters always gave me back empty values or even the error Bad Request.

Then I found out that the string representation of an empty Guid or even null value must be the Guid.Empty value '00000000-0000-0000-0000-000000000000' otherwise you might get a Bad Request or some strange behavior.

Even worse was the transfer of an empty date parameter or property.
I thought it will be good enough to have like this string representation for an empty date field "".
Or even most common schemas like "2010-5-5" and so would not work and always give back a Bad Request message.

Then after trying to post back a date value from my WCF REST Service to the client I found out that the expected format looks something like this: "\/Date(946645200000+1100)\/"
After some research I now know that this is due to how .NET converts the date obj…

CRM 4.0: Unable to re-provision CRM 4.0 MUI after UR10 to UR21 upgrade

Today I tried to re-provision the CRM 4.0 MUI after an UR21 Upgrade coming from UR10.

Sadly, every time trying to provision the language I retrieved an error. Turning on the error log this allowed me to find the real problem that I was facing here:

Violation of PRIMARY KEY constraint 'XPKLocalizedLabel'. Cannot insert duplicate key in object 'MetadataSchema.LocalizedLabel'.

The error occured while trying to execute the follwoing SQL Statement:
INSERT INTO LocalizedLabel ( LocalizedLabelId,
LanguageId,
ObjectId,
ObjectColumnName,
Label,
InProduction,
CustomizationLevel ) VALUES ( '0bd8a218-2341-1033-898a-0007e9e17ebd',
1033,
'0ad8a218-2341-db11-898a-0007e9e17ebd',
'DisplayName',
'Preferred Customer',
1,
System )

checking on web search I found this page:
http://msdn.microsoft.com/en-us/library/ee704626.aspx

The page specifies the following allowed values for the CustomizationLevel column:

ValueDescription0Indicates that the visualization is …

CRM 2013: fn_GetLocalizedLabel in custom CRM SQL Report and LabelTypeCode parameter

Today I tried to migrate a custom CRM 4.0 SQL report to the a CRM 2013 SQL report.
In the report designer I hit the preview button and received the following error:

TITLE: Microsoft SQL Server Report Designer
------------------------------
An error occurred while executing the query.
An insufficient number of arguments were supplied for the procedure or function dbo.fn_GetLocalizedLabel.

OK, this means the SQL function "fn_GetLocalizedLabel" in CRM 4.0 used to have one parameter less than in CRM 2011 or CRM 2013.

After comparing the paramter signatures with the SQL database version I found this definition:

function[dbo].[fn_GetLocalizedLabel](
    @ObjectIduniqueidentifier,
    @ColumnNamenvarchar(255),
    @LabelTypeCodeint,
    @LanguageCodeint
)
returnsnvarchar(255)
as
begin
declare @LocalizedLabelnvarchar(255)

begin
select @LocalizedLabel=l.Label
fromLocalizedLabelViewl
where @ObjectId=l.ObjectId
and @LanguageCode=l.LanguageId
and @ColumnName=l.ObjectColumnName
and @LabelTypeCode=l.Label…