RE: Showing custom image in Dynamics365 Event Portal
Hi Lanzo,
Thanks for sharing you version.
Could you confirm that the issue also exists in your Portal?
It's easy to use custom field as alternative to default image field.
Part 1: Create a flow to sync event image URL to custom field of Event entiy
1. Create a custom field for Event entity to save image file URL
2. Create a flow, e.g:
When an event is selected,(to make this action appears, we should select any of record in entitylist, then click Flow > Create a flow)
check whether Event Image field contains data,
if there is a image file selected, update the selected event custom field with image URL
The correct field is "BLOB CDN URL":
Part 2:
Expose custom field to Event API:
Add custom logic inside event.component.ts(in src/app/components/event folder) > getBannerImage function:
public getBannerImage() {
if (this.event == null) {
// This early exit avoids showing placeholder image while event isn't loaded.
return '';
}
if (this.event.image != null) {
return this.event.image;
} else {
if (environment.useRestStack === true) {
if (this.event.customFields.hasOwnProperty("new_eventimageurl")) {
if (this.event.customFields["new_eventimageurl"] !== null) {
return this.event.customFields["new_eventimageurl"];
}
} else {
return this.imageHelper.getImageUrl(this.defaultImageUrlSelfHosted);
}
} else {
return this.imageHelper.getImageUrl(this.defaultImageUrlCrmHosted);
}
}
}
Result:
In short, due to there is issue in Event API image field, so we fetch event image blob URL manually.
Regards,
Clofly