Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Unanswered

Image attributes and primary image

Posted on by 20

I have an image attribute on a custom entity, however, I am not able to check the box:

pastedimage1595510527328v1.jpeg

I have set the Primary Image field for the entity to the image attribute.

pastedimage1595510665249v3.png

My hunch is that this is not working because when I created the entity, I set the schema name of the ImageAttributeMetadata to something other than "EntityImage."

However, according to the docs:

1. "There can be multiple image attributes in an entity instance but there can be only one primary image. However, you can change the primary image from one image to another by setting IsPrimaryImage for that attribute to true." (https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/image-attributes)

2. "You can add image attributes to custom entities. When an entity has an image attribute, you can set the PrimaryImageAttribute property to control whether the image will be shown in the application. When the image is shown in the application users of the web application can upload pictures for the entity record." (https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/introduction-entities#entity-images)

Yet, also according to the docs:

3. "For those entities which support image attributes, the SchemaName of the entity image attribute is always EntityImage." (https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/introduction-entity-attributes#image-data-attributes)

4. "When an entity contains a ImageAttributeMetadata attribute this value will be the name of the attribute containing the image used in the application. Each entity can have only one image attribute and the logical name of that attribute is always entityimage. This property has been added to prepare for a future release in which entities may support multiple image attributes and there may be need to change which image is used as the primary image for the entity" (https://docs.microsoft.com/en-us/dotnet/api/microsoft.xrm.sdk.metadata.entitymetadata.primaryimageattribute?view=dynamics-general-ce-9#Microsoft_Xrm_Sdk_Metadata_EntityMetadata_PrimaryImageAttribute)

 

I was hoping that the first two statements were correct so that I could indeed swap out various image attributes if needed, but I suspect this is not the case.  For the record, in the entitymetadata for my custom entity, the "PrimaryImageAttribute" property does contain the correct image attribute name, however, that name is not "entityimage"

It is quite frustrating when the docs seem to contradict themselves.

Can anyone clarify which is the correct statement?  If it is the first, any ideas about how to enable the checkbox in the first image so the image will appear on the form?

  • Majellin Profile Picture
    Majellin 20 on at
    RE: Image attributes and primary image

    Unfortunately this is not true in my case.  I think it might be something to do with using on-premises, although the post you linked seems to be on-premises as well, at least from the links in their post (although their UI looks different from mine).

    pastedimage1599847226174v1.png

    pastedimage1599847436132v2.png

    pastedimage1599848952142v7.png <-- The circle is not clickable/editable

    pastedimage1599847494147v3.png

    pastedimage1599847528937v4.png

    pastedimage1599847578017v5.png

    As you can see, the image does not display on the form, even though the entity has an image field. In the old UI there is nothing there and in Unified Interface the green circle is not clickable to edit.

    Further, if I try to add an Image Field to an entity, the schema name gets locked to "entityimage" and I cannot change it.

    pastedimage1599849039110v8.png

  • RE: Image attributes and primary image

    The short answer: The Show image in the form checkbox is deprecated and not needed in Unified Interface.

    In Unified Interface, once you have an Image field and point to it in Entity definition, you will see the image in the forms irrespective of that flag. Also, the Schema Name for the Image field can be anything, not necessarily EntityImage.

    More details here: https://community.dynamics.com/365/fieldservice/f/dynamics-365-for-field-service-forum/384705/image-field-in-entity

  • RE: Image attributes and primary image

    Hello Majellin, the difference in the documentation might be related to version.

    Could you please confirm your CRM build version?

    Is there a particular reason to set schema name other than EntityImage?

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans