I’m working on DYNAMIC-PAGE including a DYNAMIC-DATASET.
Is it possible to change the boolean Field Type in the database from true to false when I click the button in the current item page? how can I write this code?
@qvelo78
Ok, now your setup is clear.
You have a dynamic-page (connected with a dataset).
You will need → getCurrentItem() ←
to get the data of the current item including all DB-values.
So how to do? How to write the code?
$w.onReady(()=>{
$w(‘#elementID’).onClick(()=>{
let myItem=$w(‘#dataset’).getCurrentItem().then(()=>{console.log(myItem);
//the rest of your code here…
console.log(myItem.title);
console.log(myItem.stock);
//changing stock-status…
myItem.stock=false;
console.log("stock-status after change ", myItem.stock);