Skip to main content

Posts

Showing posts from June, 2014

Yet Another Address Autocomplete PCF Control–powered by Bing

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…