locked
"Unable to get property 'optional' of undefined or null reference" on a screen with more than one parameter RRS feed

  • Question

  • I'm trying to make a screen which will show a list of "Properties" (houses) for the current Agent or Property_Type. Agent and Property_Type are child records of a Property.

    So, I made a Query on the Properties Table which has 2 filters:

    Where Property.AgentId = AgentId (optional parameter)

    Or Property.PropertyType = Property_Type (optional parameter)

    I then make a screen based on the Query called PropertiesSelection.

    I make both AgentId and Property_Type parameters of the screen.

    I then go to my Property_Summary screen which shows all the details for the current property, including Agent and Property_Type.

    I add tap events for Agent and Property_Type to display PropertiesSelection and pass the Parameters Property.Agent and Property.PropertyType respectively for each tap event.

    When running the app, I try to click through to my Property_Summary screen and get this error.

    Error

    Unable to get property 'optional' of undefined or null reference

    If I only have one parameter on the PropertiesSelection screen then it works fine.

    I really think this should work. Anyone have any ideas or is this a bug in lightswitch?

    I'm getting around this by doing 2 separate screens (PropertiesByAgent and PropertiesByPropertyType) which is not ideal as it's twice the work (and I actually have 4 screens I want to do this to)

     

    (Note that my table is actually called Property_ due to the reserved keyword, I just changed it above for clarity)

    Sunday, June 2, 2013 4:36 AM