Search code examples
visual-studio-lightswitch

Lightswitch html client Unsaved changes on page


I had a details screen which I changed to a browse screen. I implemented a save button which calls myapp.commitChanges();. I am facing an issue now where if I am on that details page and navigate away from the page to a new screen I get an pop up saying there are unsaved changes on the screen.

Thanks


Solution

  • have you tried using this code below:

    myapp.applyChanges();
    
    setTimeout(function ({
      screen.tablenames.load() 
    }, 100)
    

    this code above will save all the changes currently on the screen, and then the setTimeout code refreshes the table view, this should prevent the screen saying that there is unsaved data...

    if you require any more assistance please let me know, or a little more information like the table name will help