i am trying to create a calendar entry from a custom module based on departure date and return date i need it to create an entry in the calendar for the full duration of the trip so i know when a customer is on holidays and when they return home ideally this needs to be automation once the holiday is booked i have a picklist that i selected depending on the stage i have tried using this which i found but having now luck
// Get values from the Bookings New module
departureDate = ["Departure_Date_B"];
returnDate = [Return_Date_B];
eventName = "Booking for " + [BookingsReference]; // Customize as needed
// Calculate the duration
durationDays = dateDiff(returnDate, departureDate);
// Create the calendar entry
entry = zoho.crm.create("Calendar_Entries", {
"Event_Name": eventName,
"Start_Date_and_Time": departureDate,
"End_Date_and_Time": dateAdd(departureDate, durationDays, "days")});
// Add other necessary fields
info entry; // Print the created entry for reference
any help will be great ive also got a couple of little other ones if anyone charges to code very small jobs like the one above about 5 of them