Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Suggested answer

Help on event URL

(0) ShareShare
ReportReport
Posted on by 2

Hi all,

I update event Angular code to process url pattern "myeventportal.microsoftcrmportals.com/event/MyEventId". I don't want to use "?id=" in my URL.

I run successfully when I open the event home page and click on an event to jump to event detail page, but it failed when I open the event detail page directly.

I think it isn't loading the Angular page. Do you know how to fix this or have a work-around on this?

EventError.png

Thanks!

  • Suggested answer
    ShravanSuri Profile Picture
    ShravanSuri 1,255 on at
    RE: Help on event URL

    Hey - glad to see that you've resolved this issue. Thanks Clofly!

    We've also taken this scenario and shared it with the team. If you have further questions - please don't hesitate to reach out via the forums.

    Thanks,

    Shravan Suri

    PM, D365 Marketing

  • Suggested answer
    truc binh Profile Picture
    truc binh 2 on at
    RE: Help on event URL

    Hi Clofly,

    Thank you very much for your detail feedback.

    I found a work-around for this.

    I am doing in a different way.

    I include id into the route like this.

    EventRoute.PNG

    In the code, I modified to get the id.

    EventCode.PNG

    But I get the error when I open the link with event id directly.

    The reason is the portal cannot find the page with that name when we open the link directly. I create a child page with the partial url is the eventid, and now I can open the link successfully.

    CRMChildPage.PNG

    From now, with each event, I will create a child page with eventId as Partial URL and the event portal can run successfully if users open the link directly.

    Thanks,

    Binh

  • cloflyMao Profile Picture
    cloflyMao 25,202 on at
    RE: Help on event URL

    Hi truc,

    The URL format "?id="  is used to pass parameters, and Angular uses its paramMap interface to get parameters after ? symbol.

    That's by design, I recommed you not change this format. 

    Of course, you can still change format(and you've changed it), the reason for issue you encountered is that paramMap.get in event.component.ts and sessions.component.ts can't get id parameters from URL  

    because you had changed it from "event?id=x" to "event/x".

    The format "event/x" is more likely to represent a web page instead of it's passing a parameter.

    It seems that you had changed routerLink attribute of link element to href attribute, would my guess be right?

    pastedimage1582901657142v1.png

    To make your URL format works, you should do following steps:(My demo is based on static readableId)

    1. Add readableID as a child path to event path in routes.ts.

    pastedimage1582901813938v2.png

    2. Assign readableEventId(x) to readableEventId variable in event.component.ts,

    because sessiontracks, spearkers and passes will all use this value to retrieve data in event.component.ts.

    pastedimage1582901974872v3.png 

    3. Also, assign readableEventId(x) to readableEventId variable in event.component.ts,

    because subscribeToEventChange function will be executed when sessions.component.ts onInit event.

     pastedimage1582902152456v4.png

    4. By doing above steps, then you page could display in customized format.

    pastedimage1582902336631v6.png

    In a word, you should write custom js code to query last pathname in customized URL instead of querying parameters.

    However, the real trouble is that every path names in routes.ts are static, while readableEventId is a dynamic value,

    it would be dificult to get URL pathname in routes.ts, and routes.ts will always regards event/a or event/b as a path instead of a parameter.

    So my final suggestion is that you should keep origin URL format.

    Regards,

    Clofly  

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,971 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,846 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans