Dataset not working.

I have two datasets on this page. One for form submission and one connected for repeater.
Both are working well before in Preview. Just yesterday I try if all are working when published, then the datasets won’t load in Preview but in Live it is working. But in Live, I cant submit in form.

I tried not to use dataset and replace it with insert in collection still not working.

Collection setting is for Anyone.

All I can say is that all is working great before, it’s just yesterday everything flipped where I’m ready to present what I worked to client today. Frustrating, I hope someone can help.

Can you attach screenshots?

This is my code.

I put onReady function on dataset then show hidden and disabled items after.

$w.onReady(function () {
$w('#text84').text = "" + dateChanger();
$w('#text86').text = "" + expDateChanger();
$w('#manuSubmitBtn').disable();
$w("#addManuDataset").onReady( () => {
console.log("Manu Dataset is ready")
$w('#manuSubmitBtn').enable();
} );
$w("#manuListDataset").onReady( () => {
console.log("ManuList Dataset is ready")
$w('#box7').show();
$w('#repeater2').show();
} );
});

This will appear on Preview. (it doesnt load datasets)

And this is for Live. It loads, but there will be error in submission.


When you click submit, this error appears.

How do you do the sending? The guard?
Can you send the code?

And what is this code, too?

$ w (‘# text84’). text = “” + dateChanger ();
$ w (‘# text86’). text = “” + expDateChanger ();

With the error that you are getting - Operation (save) not allowed during save - you will need to check and rework your code as you trying to call a function (which is the save in the brackets) and you are calling it during the save process of the dataset, hence why it causing an error.

You can also work with the database itself and not use a dataset as J.D. talks about in this old post here.
https://www.wix.com/corvid/forum/community-discussion/dataseterror-save-during-save

Is that your full code for that page or have you got a onBeforeSave or onAfterSave? That might be causing it if you have it set up to save with the submit button and it is wrapped up in the OnBeforeSave or the onAfterSave.

If you have, then you need to make sure that they are not in the same process and they have their own opening and closing brackets etc.

From last year as well.
https://www.wix.com/corvid/forum/community-discussion/button-becomes-disabled-from-another-button-onclick

this is my code when saving

$w("#addManuDataset").setFieldValues( {
"lotId":        dateChanger(),
"description": $w("#descInput").value,
"quantity":   $w("#qtyInput").value,
"remaining":   $w("#qtyInput").value,
"manufacturingDate": manudate,
"expirationDate" : exfulldate,
"sold": 0
} );
$w("#addManuDataset").save()
.then( () => {
$w("#manuListDataset").refresh();
$w("#addManuDataset").refresh();
console.log("Done refreshing the dataset");
} );

I also tried inserting it directly to collection not using datasets, still not working.

But my main problem is that why my datasets doesn’t load in PREVIEW and it loads in LIVE. My datasets are working days ago and it’s just the other day its not. No changes have been made, I just publish it to see if it is working LIVE.
It frustrates me when I’m almost done, the datasets stops in all pages.

$ w (‘# text84’). text = “” + dateChanger ();
$ w (‘# text86’). text = “” + expDateChanger ()

This are just for displays (all working fine) no connection on datasets.

For my code please see below in my reply to GOS. Thanks. I hope you can help me.