How do you EXPLAIN that a API code, one day STOP WORKING ?

Our Page coding is done from more than 1 year : Perfectly Working! We Use this page inut forms last Saturday, All was good! This Monday, Coding not working anymore! LIVE SITE + PREVIEW! ciblehockey.com How can you explain ?



Not these 2 ones, All drops similar coding + table rows similar coding in the page not working anymnore!

I’m tired, not the first time we need to change the coding of our pages because one morning we wake-up and all stop working for any reasons!!!

Your code was poorly written in the first place, to the point where an error was very likely to occur, and I’m surprised it took this long. If you’d like help, post it here as a code block.

Thanks For answer!!! My problem is the SORT values , I forgot we change the sorting method, why this code not working anymore! I apologize to WIX… How you could code it ?


export function table5_rowSelect(event) {
//Add your code for this event here:
let rowData = event.rowData;
//console.log(rowData);
wixData.query(“StatsPlayerList2”)
.eq(“teams”,rowData.teams)
.eq(“teamShortName”,rowData.teamShortName)
.find()
.then((results)=>{
let item=results.items[0];
wixData.save(“StatsPlayerList2”,item)
.then((res)=>{
$w(“#dataset4”).refresh()
$w(“#button96”).enable();
$w(“#button80”).enable();
$w(“#button72”).disable();
$w(“#button71”).disable();
$w(“#button73”).disable();
$w(“#button74”).disable();
$w(“#button89”).disable();
$w(“#button90”).disable();
$w(“#button91”).disable();

$w("#dataset5").refresh()

$w(“#dataset6”).refresh()
$w(“#dataset7”).refresh()
$w(“#dataset9”).refresh()
console.log(“Active Row”);
} );
} );
}

export function dropdown64_change(event) {
//Add your code for this event here:
//let itemObj = $w(“#dataset4”).getCurrentItem();
//console.log(itemObj._id);
buttondisable();
$w(“#button96”).enable();
$w(“#button80”).enable();
$w(“#button89”).disable();
$w(“#button90”).disable();
$w(“#button91”).disable();
$w(“#button72”).disable();
let dropdown64=$w(“#dropdown64”).value;
console.log(dropdown64);
wixData.query(“StatsPlayerList2”)
.eq(“teams”, dropdown64)
.find()
.then( (results) => {
let items = results.items;
let firstItem = items[0];
wixData.save(“StatsPlayerList2”,firstItem)
.then((results)=> {
console.log(“Active row”);
let updatedlist = results;
})
.then(() => {
$w(“#dataset4”).refresh()
$w(“#dataset5”).refresh()
// $w(“#dataset6”).refresh()
// $w(“#dataset7”).refresh()
console.log(“Done refreshing the dataset”);
} )
} )
.catch( (error) => {
let errorMsg = error.message;
let code = error.code;
} );
}

The code below will be less error prone for the dropdown change, and you can see some of the patterns here you can apply to your table5_rowSelect. However, an error in the rest of your code can still throw it off, including your buttondisable function.

export function dropdown64_change(event) {
buttondisable();
$w("#button96, #button80").enable();
$w("#button89, #button90, #button91, #button72").disable();
wixData.query("StatsPlayerList2")
.eq("teams", $w("#dropdown64").value).find()
.then(results => {
let firstItem = results.items[0];
wixData.save("StatsPlayerList2", firstItem)
.then(() => $w("#dataset4, #dataset5").refresh())
.catch(err => console.error('Save failed: ' + err.message));
}).then(() => console.log('Successful query!'))
.catch(err => console.error(err.message));
}

good try David! but this code do not display any error but there’s one in it for sure. Inserting this code Block all code page execution. will keep mine!

On what page are you seeing the problem?