Questions about $w("#dataset1").setFieldValue

I have built a dataset that requires user updates on a regular basis. I am using page code to update individual fields in the dataset because they need calculation and I can control the timing of the ‘database update’ all in one place for all processes I am working on.

I have encountered situations where $w(“#dataset1”).setFieldValue, even though it is properly formatted and working in some rows of the dataset, ceases to work in other rows with the same data. Console.logs show that the data is being correctly manipulated and placed into the correct variable for loading, as in: $w(“#dataset1”).setFieldValue(“fieldName”, calculatedvalue).

I use ‘next’ and ‘back’ buttons to move through the dataset.

Any idea why this would stop working when it was working properly before? My console.logs show everything seems fine, but the dataset does not update, and if I try to use dataset.save() i get a timing error on the console.

Does it still not work?

That’s correct, even with the changes, it still does not work. I have done the same code in a hook in data.js and it worked fine, but because there are additional calculations that go on top of the initial calculations, I did not want to link the before_update or after_update process to be automatic whenever a change is done, you can imagine what kind of chaos that would entail if two different pages are fighting for the update processes on the same database. That’s why the process if broken down into individual buttons, each one performing a function once I know, for a fact, that the previous other steps have been properly performed. If there is a permissions problem, then if there is a way to override them, that will be helpful. Otherwise, I am at a loss right now. Any advice, suggestions, will be appreciated.

Hey
Post the code formatted as code here where you do the calculations