none
How to clear an Error Stack RRS feed

  • Question

  • Hey everyone,

    i try to clear the Lightswitch Error Stack in a Application.

    The case:

    I get an entity error when i try to save. When i correct these entity error without to save these change and change another entity(another textfield) to a value which makes an entity error and try to save these changes i get two entity errors. One of them is the change entity to the correct value and one error from the change to the wrong value.

    Now i try to clear these Stack that the application only shows me the real entity error.

    Any suggestions? Thanks..


    Tuesday, November 19, 2013 3:38 PM

All replies

  • Hi,

    Firstly, I suggest you to clean and rebuild the solution.

    Would you please provide us with the error message or the entities if the error still appears after that?

    I am not sure the relationship bewtween the entities. Also, based on my experience, the stack error may be caused by the threading issue. However, it seems that you do not use theading acording to your description. And the error is a general error.

    So, please provide us with more details and it will be very helpful.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. <br/> Click <a href="http://support.microsoft.com/common/survey.aspx?showpage=1&scid=sw%3Ben%3B3559&theme=tech"> HERE</a> to participate the survey.

    Wednesday, November 20, 2013 8:57 AM
  • Hey,

    thanks for your answer. Maybe i dont was clear enough.

    I run the Lightswitch Application and it works fine.

    I just have two Textfields with two Validations Rules on Save. I throw the Error over the command:

    results.AddEntityError("....");

    When i make wrong input in Textfield A and try to save i get an Error.

    I correct the Input in Textfield A but dont save it and make a wrong Input on Textfield B.

    At this point i hit the Save Button and get two Errors. One on Textfield A (value is right) and on Textfield B(value is wrong).

    I need a method which clear the Error Stack that in this case i only get an Error on Textfield B and not on A anymore.

    Greets

    Wednesday, November 20, 2013 10:41 AM
  • Hi,

    Do you mean that you put two validation rules on one save button? If so, I'd like to suggest you to custom the two validation rules separately.

    Regarding data validation, you may refer to the articles below:(pay attention to the version of Visual Studio)

    How to: Validate Data in a LightSwitch Application

    Validating Data in a LightSwitch Application

    Overview of Data Validation in LightSwitch Applications (Prem Ramanathan)

    Hope it helps.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, November 20, 2013 12:07 PM
  • Hey.

    No the Validation Code is good. 

    The point is that, the user see's that theres is an Error on Textfield A and B while Textfield B only has a wrong value on save. Lightswitch seems to add these Error on Textfield B to the Error stack an shows the complete Stack with the Error on Textfield A and B.

    My idea is to clear the Error stack before the Validation Code is execute. At these Point only the Error from Textfield B is on the Error stack but i have no idea how to clear these stack

    Greets

    Wednesday, November 20, 2013 1:03 PM
  • Hi,

    What knid of the error is it? Would you please provide us with the error message?

    In addition, does the error stack disappear if you make a correct value in Texyfield B?

    Please provide me with more details to troubleshoot.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, November 22, 2013 9:20 AM