Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

Error mapping optionset on virtual entity

Posted on by 55

Hi,

When mapping an optionset on a virtual entity to its external data source got the following error:

Type mismatch of the external attribute of type sysyem.nullable[system.int32] expected a system.nullable[system.int32, microsoft.xrm.dataprovider.odata614d0bd27de7e9119c27005056876672

Unfortunately there are not so mucj documentations on virtual entitis optionsets!

  • ShaneBaartman Profile Picture
    ShaneBaartman 5 on at
    RE: Error mapping optionset on virtual entity

    Did you ever get this optionset mapped correctly? 

    my question is after they enabled CRUD on the Odata v4 Provider, are you able to change optionset values when updating this table?

  • Suggested answer
    RE: Error mapping optionset on virtual entity

    Hello, while int32 is a supported type, it cannot be used for option sets. Int32 is only for numbers.

    docs.microsoft.com/.../virtual-entity-odata-provider-requirements

    In order to map an option set in CRM, you need to use an enumeration in your OData and then map all the options in your option set field.

    <EnumType Name="MessageType" IsFlags="true">

     <Member Name="Unknown" Value="0" />

     <Member Name="Incident" Value="1" />

     <Member Name="PlannedMaintenance" Value="2" />

     <Member Name="MessageCenter" Value="4" />

    </EnumType>

  • RE: Error mapping optionset on virtual entity

    We did not use a custom provider. The external database were exposed as web api over oData. The type of data we are mapping is Int32 and mapping it to an optionset in CRM. According to MS documentations this type is supported, but there are no samples to show how to map an optionset.

  • RE: Error mapping optionset on virtual entity

    Hello,

    For these types of errors, it's either a problem with the mapping inside of CRM, or if you are using a custom provider, then it could also be a code problem.

    Could you share more details about your scenario and configuration ?

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,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans