I have an image attribute on a custom entity, however, I am not able to check the box:
I have set the Primary Image field for the entity to the image attribute.
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?
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).
<-- The circle is not clickable/editable
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.
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
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?
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156