I have a booking page similar to the timetable example on my website.
While loading this booking page, I encounter an error like in the image.
I think the cause of the error is from Wix’s backend functions. What is the cause and solution of the error?
@lebedenkodd Hello. The original issue should’ve been fixed by now. Can you please give more details about what exactly is not working on your website (steps to reproduce) so that we can check if it is a different issue or the old one wasn’t fixed properly.
@aleksander-denga Hi. url ==> www. lawhero. ca / booking / .Go through the flow, choose the “Family law” specialization, than any lawyer and service, then in the Add Your Info section, choose any value in “Select at day” and look at the console. Sometimes it works correctly, and often an error on getAppToken
@lebedenkodd Hello. I tried to reproduce the issue on your website, but didn’t get the result you mentioned. Here is my video recording with open console. Any chance you could share similar video fragment describing the way to reproduce the issue with the screenshot of the console error?
let current = $w("#dynamicDataset").getCurrentItem.File();
if (!current) {
$w("#button1").disable();
$w('#text29').text='No file to download. Button disabled!';
}
else {
$w("#button1").enable();
$w('#text29').text='Button functional! Proceed with download';
}
This is the error:
Cannot read property ‘File’ of undefined
First, this code needs to be inside of a datasetonReady() to ensure that the dataset is available to use. And then the whole thing needs to be inside of a pageonReady() .
In addition, getCurrentItem() is a function and needs the parentheses. And, there is no File() function on getCurrentItem() and therefore it is undefined.
Perhaps, what you want is the following?
let current Item = $w("#dynamicDataset").getCurrentItem()
let file = currentItem.file;
It’s best to start a new post instead of commenting on another unrelated issue. You’ll have a better chance of getting assistance.