Form OnLoad vs OnDataLoad


There are two different onLoad events in the client-side XRM framework: OnDataLoad and OnLoad. OnDataLoad happens on initial page load, when formContext.data.refresh is called, or when the data is saved and there is a change. OnLoad is called on initial page load and when a new record is first saved. When specifying an event handler in the form designer, you are specifying the OnLoad event handler. It won't trigger when you call formContext.data.refresh, so if you need something to happen after the refresh, you may need to attach one more event from code using formContext.data.addOnLoad. The function you pass as an argument will be called right away (after the onLoad) and whenever you use formContext.data.refresh.


Article 12m

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