Hide Expired Sessions in Event Registration Form using JavaScript (Dynamics 365 Customer Insights – Journeys)


To enhance user experience, a requirement was introduced to prevent users from registering for event sessions after they have ended. Utilizing the 'Default registration form with Sessions' from Microsoft, a JavaScript customization was added. This script activates after the form loads by subscribing to the 'd365mkt-afterformload' event. It checks session end dates and times against the current browser time (all users are in the New Zealand time zone) and hides any expired sessions from the UI, including the entire Sessions section if all sessions have expired. This ensures that users can only register for active sessions, streamlining the Event Registration process by removing unavailable options. The solution focuses on UI changes rather than server-side validation.


Article 2w

Login now to access my digest by 365.Training

Learn how my digest works
Features
  • Articles, blogs, podcasts, training, and videos
  • Quick read TL;DRs for each item
  • Advanced filtering to prioritize what you care about
  • Quick views to isolate what you are looking for right now
  • Save your favorite items
  • Share your favorites
  • Snooze items you want to revisit when you have more time