Hello All,
I am using a custom event field on the event portal, added the field in the Selected fields of Website Entity Configuration.
And i can refer it as this.event.customFields.msevtmgt_expectedoutcome in the event.component.html
I am bit confused how to refer this custom field in the event.component.ts
For example console.log(this.event.customFields.msevtmgt_expectedoutcome);
I tried to follow steps mentioned in https://pkoval.com/2019/04/07/extending-dynamics-marketing-event-management-portals/
1) Created a Web Page, Page Template and Web Template with liquid script as mentioned
2) Added ExpectedOutcome.ts class in the \src\app\models
export interface Outcome { expectedoutcome: string; }
3) getExpectedOutcome(readableEventId: string): Observable<string>; Added in the EventService.ts class
4) Implemented the same function in EventD365Service, EventRestService.
public getExpectedOutcome(readableEventId: string): Observable<string> {
return this.http.get(
`${environment.apiEndpoint}${EventD365Service.eventsEndpoint}/expectedoutcome/?readableEventId=${readableEventId}`
);
}
}
5) Added below line in event.component.ts
this.outcome = await this.eventService.getExpectedOutcome(this.readableEventId).toPromise();
My requirement is
I want my own WebAPI to return me event ID based on custom field event language and event category.
My questions are :
Q1) What should be type of 'T' the function getExpectedOutcome(readableEventId: string): Observable<T>;??
Q2) This function should be implemented in both the event.rest.service.ts and event.d365.service.ts??
Q3) Is there any other way to create own Web API?
NOTE: I am running the Event Portal on my local host after customization is this the reason i am not getting the value of the Web API
I am bit confused. Can any one help me.
Kind Regards
Abhilash