Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Invalid Argument error when searching for an existing product in French

Posted on by

Hi, 

We are using Dynamics CRM Online 2016 Update (8.1.0.534) and users with language set in French are getting an Invalid Argument error message when trying to search an existing product to add to a quote.

This is very strange since users with language set in English are able to see the search results and add the product to the quote. 

Please see screenshots. 

Users in French searching existing product to add to quote. Search = 24

2016_2D00_11_2D00_04_5F00_Invalid-argument-search-result-in-French.png

Users in English searching existing product to add to quote. Search = 24

2016_2D00_11_2D00_04_5F00_Existing-product-search-in-English.png

Has anyone already encountered such issue? Could you please advise on how to fix this?

Thanks, 

Regards.

*This post is locked for comments

  • Invalid Argument error when searching for an existing product in French
    The project I am working on has run into this as well, but we will be moving to the Cloud in a few months. Does anyone know if this is still an issue on the Cloud?
     
    Many thanks in advance,
    Ben
  • Suggested answer
    H J Shakib Profile Picture
    H J Shakib 85 on at
    RE: Invalid Argument error when searching for an existing product in French

    After lots of digging i came to this solution:

    1. Open the organization database.
    2. Find "SavedQuery" view and alter it.
    3. Find this: "[T1].[ReturnedTypeCode]" and replace it with this: 
      CASE WHEN (T1.SavedQueryId = N'A2CC2D8E-9768-DD11-B1B0-00155D869F00') THEN 1039 ELSE [T1].[ReturnedTypeCode] END ReturnedTypeCode
    4. Execute and then recycle the CRM application pool in IIS.

    But Why and How!?

    Base on the error:

    Inner Exception: Microsoft.Crm.CrmArgumentException: The object type code 1026 does not map to a specific label type code
    at Microsoft.Crm.Metadata.LabelTypeCodeHelper.GetLabelTypeCodeFromObjectTypeCode(Int32 objectTypeCode)
    
    ...

    I decompiled the CRM assembly and found the method which the error occurs: 

    0763.LabelTypeCodeHelper.png

    So base on this method if "objecttypecode" 1026 come through then definitely the exception will be thrown, but why this typecode come to this method which they didn't expect?!, don't know and i think its a bug.

    So after this, i ran Sql profile and found that this "objecttypecode" comes from Selecting the "SavedQuery" view and only happens on "Quick Find Product Price Levels" view with id "A2CC2D8E-9768-DD11-B1B0-00155D869F00" of "ProductPriceLevel" entity:

    exec sp_executesql N'select 
    "savedquery0".FetchXml as "fetchxml"
    , "savedquery0".StateCode as "statecode"
    , "savedquery0".CreatedBy as "createdby"
    , "savedquery0".ColumnSetXml as "columnsetxml"
    , coalesce("LL0".Label,"LL1".Label, "savedquery0".Name ) as "name"
    , "savedquery0".QueryType as "querytype"
    , "savedquery0".AdvancedGroupBy as "advancedgroupby"
    , "savedquery0".ModifiedBy as "modifiedby"
    , "savedquery0".ReturnedTypeCode as "returnedtypecode"
    , "savedquery0".CreatedOn as "createdon"
    , "savedquery0".LayoutXml as "layoutxml"
    , coalesce("LL2".Label,"LL3".Label, "savedquery0".Description ) as "description"
    , "savedquery0".ModifiedOnBehalfBy as "modifiedonbehalfby"
    , "savedquery0".ConditionalFormatting as "conditionalformatting"
    , "savedquery0".StatusCode as "statuscode"
    , "savedquery0".CreatedOnBehalfBy as "createdonbehalfby"
    , "savedquery0".ModifiedOn as "modifiedon"
    , convert(bigint, "savedquery0".VersionNumber) as "versionnumber"
    , "savedquery0".QueryAPI as "queryapi"
    , "savedquery0".ComponentState as "componentstate"
    , "savedquery0".SolutionId as "solutionid"
    , "savedquery0".SavedQueryId as "savedqueryid"
    , "savedquery0".OrganizationId as "organizationid"
    , "savedquery0".CreatedByName as "createdbyname"
    , "savedquery0".CreatedByYomiName as "createdbyyominame"
    , "savedquery0".ModifiedByName as "modifiedbyname"
    , "savedquery0".ModifiedByYomiName as "modifiedbyyominame"
    , "savedquery0".ModifiedOnBehalfByYomiName as "modifiedonbehalfbyyominame"
    , "savedquery0".ModifiedOnBehalfByName as "modifiedonbehalfbyname"
    , "savedquery0".CreatedOnBehalfByYomiName as "createdonbehalfbyyominame"
    , "savedquery0".CreatedOnBehalfByName as "createdonbehalfbyname" 
    from
     SavedQuery as "savedquery0"
     left outer join LocalizedLabelView as "LL0" on ("LL0".ObjectId = "savedquery0".SavedQueryId and "LL0".LanguageId = @LanguageId0 and "LL0".ObjectColumnName = @ObjectColumnName0 )
     left outer join LocalizedLabelView as "LL1" on ("LL1".ObjectId = "savedquery0".SavedQueryId and "LL1".LanguageId = @LanguageId1 and "LL1".ObjectColumnName = @ObjectColumnName1 )
     left outer join LocalizedLabelView as "LL2" on ("LL2".ObjectId = "savedquery0".SavedQueryId and "LL2".LanguageId = @LanguageId2 and "LL2".ObjectColumnName = @ObjectColumnName2 )
     left outer join LocalizedLabelView as "LL3" on ("LL3".ObjectId = "savedquery0".SavedQueryId and "LL3".LanguageId = @LanguageId3 and "LL3".ObjectColumnName = @ObjectColumnName3 ) 
    where
     ("savedquery0".SavedQueryId = @SavedQueryId0)',N'@LanguageId0 int,@ObjectColumnName0 nvarchar(4),@LanguageId1 int,@ObjectColumnName1 nvarchar(4),@LanguageId2 int,@ObjectColumnName2 nvarchar(11),@LanguageId3 int,@ObjectColumnName3 nvarchar(11),@SavedQueryId0 uniqueidentifier',@LanguageId0=1036,@ObjectColumnName0=N'Name',@LanguageId1=1033,@ObjectColumnName1=N'Name',@LanguageId2=1036,@ObjectColumnName2=N'Description',@LanguageId3=1033,@ObjectColumnName3=N'Description',@SavedQueryId0='A2CC2D8E-9768-DD11-B1B0-00155D869F00'
    go


    So if we do what i told in the beginning of the post and return some objecttypecode that the method expect the error will not going to happens. 

    But what is the side effects or consequences?

    Because we changed the typecode for that specific view only, then all of the consequences should be on that view which is: You can not search the "Price list items" anymore but still you can sort or use the filters. Personally i think most of users not using that search very often, or maybe i'm wrong don't know.

  • Luca Sgaravato Profile Picture
    Luca Sgaravato 50 on at
    RE: Invalid Argument error when searching for an existing product in French

    For On-Premises deployments issue seems to be resolved by Update 2.1 (8.2.1, KB4013759).

    https://support.microsoft.com/en-gb/help/4013759/microsoft-dynamics-365-online-and-on-premises-update-2-1

  • KaiP Profile Picture
    KaiP on at
    RE: Invalid Argument error when searching for an existing product in French

    Hi Abdoul Balde,

    I have the same problem, with the language 1031.

    Baselanguage is 1033.

    I am on Dynamics 365 (8.2.0.749) on-prem.

    I already checked the labels on the SQL-Server but didn't find a mistake:

    SELECT *

     FROM [LocalizedLabelView] as loclab

     INNER JOIN [AttributeLogicalView] as attrlog

    ON loclab.ObjectId = attrlog.AttributeId

     INNER JOIN EntityView as entv

    ON attrlog.EntityId = entv.EntityId

     WHERE entv.LogicalName = 'productpricelevel'
    --AND loclab.ObjectColumnName = 'DisplayName'

    Thanks,
    Best regards,
    Kai

  • Abdoul Balde Profile Picture
    Abdoul Balde on at
    RE: Invalid Argument error when searching for an existing product in French

    Hi Meharin Sherif,

    Thanks for the reply but this is not the issue. I understand that the customization can only be done in English since it's the base language but in my case it is not about customizing. The users simply can't add an existing product to a quote which is basic usage of the system not customization. 

    This is the error message I am getting :

    Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: The object type code 1026 does not map to a specific label type codeDetail:
    <OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
    <ErrorCode>-2147220989</ErrorCode>
    <ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
    <Message>The object type code 1026 does not map to a specific label type code</Message>
    <Timestamp>2016-11-08T14:25:37.4695693Z</Timestamp>
    <ExceptionSource i:nil="true" />
    <InnerFault i:nil="true" />
    <OriginalException i:nil="true" />
    <TraceText i:nil="true" />
    </OrganizationServiceFault>

    Any hints on how to solve this?

    Thanks,

    Regards. 

    Abdoul.

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Invalid Argument error when searching for an existing product in French

    Hello Abdoul Balde,

    You are able to view the form for English language as you have set it as the base language for your CRM application. You can make customizations only using base language(in your case using English language). That is why you are getting an error when trying to do the same with French language which is the local language(for your case). To perform additional customization work, you must change back to the base language.

    http://stackoverflow.com/questions/21041014/unable-to-view-customize-entities-when-change-the-language-other-than-the-base-l

    Hope this helps :) Thank you

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans