onBeforeSave & onAfterSave issues with Lightbox

UPDATE: After discussing your situation with another team we found that you can change the _id using the onBeforeSave hook and that is an issue on our side.
I will update this thread when there is new information regarding the issue, for the time being, what you can do is to remove the ‘Submit’ action from your button and instead giving it an onClick event with the following code

export function button1_click(event) {
    $w('#dataset1').save()
        .then(() => {
            wixWindow.lightbox.close();
        })
}
  • Lior