locked
myapp.applyChanges() does not throw validate function RRS feed

  • Question

  • I have an entity where I have created a validate function

    I have an screen where I have created my own save button with the instruction

    myapp.applyChanges();

    but this instruction does not throw validate function

    If I use the default save button in the screen the validation function Works without problems

    What it's the difference between the default save button  and myapp.applyChanges();

    Wednesday, December 11, 2013 9:05 AM

Answers

  • It won't throw an exception. It returns a WinJS promise that you have to handle to see if there are any errors:

    myapp.applyChanges().then(
        null,
        function (error) {
            alert(error);
    });


    Justin Anderson, LightSwitch Development Team

    • Marked as answer by Angie Xu Tuesday, January 7, 2014 1:23 AM
    Tuesday, December 24, 2013 8:31 AM
    Moderator

All replies

  • I have an entity where I have created a validate function

    I have an screen where I have created my own save button with the instruction

    myapp.applyChanges();  but this instruction does not throw validate function

     

    For this issue, I think this is related with your codes, please take a look at your codes, and check whether it is fine.

    Since I can't reproduce your issue on my side, you can also provide your scenario below.

    Best regards

    Angie


    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.

    Tuesday, December 24, 2013 7:51 AM
  • It won't throw an exception. It returns a WinJS promise that you have to handle to see if there are any errors:

    myapp.applyChanges().then(
        null,
        function (error) {
            alert(error);
    });


    Justin Anderson, LightSwitch Development Team

    • Marked as answer by Angie Xu Tuesday, January 7, 2014 1:23 AM
    Tuesday, December 24, 2013 8:31 AM
    Moderator