locked
Can I use query_executed method to set multiple calculated fields RRS feed

  • Question

  • I need to set a textual status, e.g., "Not Launched", "Launched on Jul 24 2012" or "Terminated on Jul 24 2012", plus set some bit calculated columns that will control whether certain buttons, such as "Launch" and "Terminate" will be visible/active for the User.  I could write the code for each calculated field's "Edit Method" but the conditions are the same so I'll be repeating conditional code in at least three places.

    I'd like to handle this in what looks to me like being a for-each loop and I'd have expected to be able to set this.calcField1 within it (or the equivalent of "this"), but having searched the 'net for examples, I've come up bereft of even one!  There are a few mentions  of the method and I have the "Beginning LightSwitch Development" eBook from WROX that also mentions the method but gives no examples of what/when/why etc.  

    With the method signature looking like the following, and BOL giving no more than a mention, it's hard for the LS novice to know what to do with the object passed in...

    partial void Query_Executed( QueryExecutedDescriptor queryDescriptor )
          {
    
          }

    Can someone enlighten me, please?

    Thanks in advance.

    Tuesday, July 24, 2012 5:36 PM