Database problem

Can any one help, my database worked fine until last week using this code

export function submitBtn_click(event, $w) {
CanvasSize = $w( “#inputHigh” ).value + “cm x " + $w( “#inputWide” ).value + “cm”
Price = “$” + $w( ‘#Price’ ).value
$w( ‘#dataset1’ ).setFieldValues()( “dimensions” , CanvasSize)
$w( ‘#dataset1’ ).setFieldValue( “price” , Price)
$w( “#text1” ).text = “” + Price + " " + CanvasSize; //check if fields are returning a values
}
then i got this error The dataset didn’t load yet. You need to call setFieldValues inside the onReady for the dataset
so I added this code $w(”#dataset1").onReady( () => {

				$w("#dataset1").save(); 

But now it dont save anything to the database

Hi :raised_hand_with_fingers_splayed:

You need to make sure that the dataset is ready by using its onReady() function inside the page’s onReady() function.

Also, the setFieldValues() function should be placed inside the dataset’s onReady() function as well as the dataset’s onBeforeSave() function, and one function is enough, don’t add more than one.

$w.onReady(() => {    
    $w('#dataset1').onReady(() => {    
        $w('#dataset1').onBeforeSave(() => {
            
            $w('#dataset1').setFieldValues({
                dimensions: CanvasSize,
                price: price
            })
            
        })
    })
    
    $w('#submitBtn').onClick((clickEvent) => {
        let CanvasSize = `${$w("#inputHigh").value}cm X ${$w("#inputWide").value}cm`;
    })
})

Hope this helps~!
Ahmad

Thanks for your help, i have added suggested code but no different when you click submit nothing happens