Programming, technology, and CRM – from a Belgian programmer exiled to Missouri
  • rss
  • Home
  • Soft Gallery
    • autosvnbackup.sh
    • VBScript Snippets
  • Contact Me
  • Welcome

SLX EntityBoundSmartPart lifecycle

Nicolas Galler | December 6, 2007

I added some logging statements to figure out what the lifecycle of user controls implementing SLX smart parts was and how it meshed with the standard ASP.NET events. This is what I came up with. SLX-specific events are in italic – the rest are standard ASP.NET (I skipped a few of the ASP.NET ones).

When the smart part is not displayed (eg an undisplayed dialog), none of the SLX stuff fires, but the standard ASP.NET still does:

  • OnInit
  • OnLoad
  • OnUnload

EntityContext.GetEntity() is available at all time but is of the type that is bound to the main form – not necessarily the same as the smartpart’s.

The first time it is displayed and bound:

  • OnInit
  • OnLoad
  • OnAddEntityBindings
  • OnLoadCurrentEntity starts
  • OnCurrentEntitySet
  • OnLoadCurrentEntity returns
  • MyDialogOpening
  • OnPreRender
  • OnFormBound (which is actually called from OnPreRender)
  • OnUnload

Again, EntityContext.GetEntity() is available but is of the type of the main form until OnCurrentEntitySet.

On postbacks:

  • OnAddEntityBindings
  • OnInit
  • OnLoad Starts
  • OnLoadCurrentEntity starts
  • OnCurrentEntitySet
  • OnLoadCurrentEntity returns
  • OnLoad Returns
  • Control postback events
  • OnPreRender
  • OnFormBound (which is actually called from OnPreRender)
  • OnUnload

EntityContext.GetEntity() is available and of the correct type.

OnFormBound is not a bad place to hook data binding stuff but it only fires from the PreRender which is a bit late sometimes. OnCurrentEntitySet executes before the bound data is saved to the entity (therefore before any SLX property change handler fires) so it is usually not great either.

Categories
Saleslogix
Tags
Favorites
Comments rss
Comments rss
Trackback
Trackback

« Slx 7.2 Web does not save (all) state between postbacks Code for the bulk edit grid view »

One Response to “SLX EntityBoundSmartPart lifecycle”

  1. Ryan Farley says:
    December 19, 2007 at 2:01 pm

    Nick,

    This is great stuff. Thanks so much for getting this all figured out and sharing this.

    -Ryan

Leave a Reply

Click here to cancel reply.

Categories

  • Experiments (4)
  • Interesting (1)
  • MSCRM (1)
  • Programming (60)
  • Rant (3)
  • Saleslogix (34)
  • Tricks (8)
  • Uncategorized (30)

Post History

  • 2010
    • January (3)
    • March (3)
    • April (2)
    • August (2)
  • 2009
    • March (2)
    • April (1)
    • May (3)
    • June (3)
    • July (1)
    • September (3)
    • October (2)
    • December (5)
  • 2008
    • January (9)
    • February (4)
    • March (9)
    • April (1)
    • May (5)
    • June (8)
    • July (1)
    • August (2)
    • September (1)
    • November (1)
    • December (3)
  • 2007
    • January (3)
    • February (7)
    • March (1)
    • April (3)
    • May (6)
    • June (2)
    • July (1)
    • August (2)
    • September (5)
    • October (3)
    • November (5)
    • December (4)
  • 2006
    • January (2)
    • September (1)
    • November (3)
    • December (4)
  • 2005
    • April (1)

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org
rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox