Hi Wix team,
I'm looking for some advice, I have 2 datasets on my payment page to save data. One for 'clients details' and one for 'course availability' Both are on write only permissions.
When testing the page for saving, it always saves to both datasets, shows in the console.log but I have noticed that the 'client details' database sometimes isn't updated with the details of the booking when someone has paid and around the 6 past bookings aren't in the database.
'Course availability' has all of the details as it should just not 'client details' database. Can someone help please? Here is the relevant code in case I'm missing something.
'Client Details' Database
else {
pending = "£" + ($w("#amount").value - ($w("#deposit").value * $w("#amount").value));
$w('#datePicker1').value = participant1DOB;
$w('#courseAvailabilityDataset').save();
sendFormData().then(() => $w("#dataset9").save())
.then((item) => {
console.log("Saved Successfully in Database.");
$w('#paymentPreLoaderBox').hide();
$w('#slideshow1').changeSlide(4);
})
.catch((err) => {
console.log("Error while saving to the database.");
console.log(err.message);
});
}
'Course Availability' Database
export function paynow_click(event) {
$w("#textFail").hide();
changeState();
payNow();
$w('#paymentPreLoaderBox').show();
$w('#courseAvailabilityDataset').setFieldValue('date', formattedDate)
$w('#courseAvailabilityDataset').setFieldValue('courseId', courseID)
$w('#courseAvailabilityDataset').setFieldValue('title', title)
$w('#courseAvailabilityDataset').setFieldValue('numberOfParticipants', $w('#participantsOrder').value)
$w('#courseAvailabilityDataset').setFieldValue('totalPrice', $w('#amount').value)
$w('#courseAvailabilityDataset').setFieldValue('paymentReceived', $w('#textDeposit').value)
$w('#courseAvailabilityDataset').setFieldValue('outstandingBalance', $w('#outstandingBalance').value)
console.log(courseID)
console.log(getDate)
console.log(title)
console.log($w('#outstandingBalance').value)
console.log($w('#participantsOrder').value)
console.log($w('#amount').value)
}
Thanks!
I have the exact same issue. My ibmexibmqc site under my ID Ibmretraitesqc has a collection named "ListeMembres" and my code saves the Dynamic form data to the collection. One out of 20 or 30 times, I am missing the entered data collected at the dynamic page. I know it was there because at the same time it saves to the collection, it also send an email with the content entered in the fields. Get all data in the email but not in the collection.
Any help!
Pierre Lacasse
ibmretraitesqc
I don't see a .save() in the paynow_click() function. How is it saving to the collection?
Anyone?