web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

create custom EntityName attribute

(0) ShareShare
ReportReport
Posted on by

I'm trying to create an attribute of the type EntityName, through the SDK.  It would mimic the Source Record Type field on the OOTB rollupfield entity (used with goal metrics), and would give me a picklist of all the entities in my org.

My application gives me this error:

attribute of type EntityNameAttributeMetadata cannot be created through the SDK


Is it completely impossible, then, to create a new attribute of the type EntityName?  Anyone gone down this road before?

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Aiden Kaskela Profile Picture
    19,696 on at

    Hi Kyle,

    You cannot create this type of attribute, per msdn.microsoft.com/.../microsoft.xrm.sdk.metadata.entitynameattributemetadata.aspx

    If you want to mimic the functionality of a picklist of entities in your org, you could write a custom plugin to do that.

    - Add an option set field to your entity. Don't add any options.

    - Add a plugin to the Publish and PublishAll events in CRM so when a customizations changes, your plugin fires.

    - When your plugin runs, retrieve all the existing entities from CRM using the RetrieveAllEntitiesRequest message

    - Compare the entities in the metadata to the options in your picklist.

    - ONLY IF THERES A CHANGE: Update the picklist options and order, then Publish the metadata for that entity.

    - When you look at your record in CRM it will have all the entities.

    If important that you only do this if there's a change, otherwise you could get stuck in an infinite loop and your plugin will fail.

    If this helps, I'd appreciate if you would mark this as a Verified answer.

    Thanks,

     Aiden

  • Community Member Profile Picture
    on at

    Well I guess I should have read the fine print in the SDK!

    Thanks for the suggestion on the plugin.

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
ScottDurow Profile Picture

ScottDurow 2

#2
GJones Profile Picture

GJones 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans