Subform Time field showing as null in script.

Subform Time field showing as null in script.

Good Afternoon everyone.

I am trying to take the information from my subform and populate it into a multiline field in the CRM. The code below works with no errors. The problem is, it shows that the Open and Close (Time fields) are null. But they are not. Any ideas of how I can fix that?
  1. //Combine Delivery times

  2. // Initialize the combined information string
  3. combined_info = "";
  4. info "Subform Data: " + input.Delivery_Receiving_Hours;

  5. // Loop through the subform rows (assuming 'Delivery_Receiving_Hours' is a subform field)
  6. for each  record in input.Delivery_Receiving_Hours {
  7.     // Check and retrieve day, time_open, and time_close
  8.     day = record.Day; // Accessing 'Day' directly

  9.     // Handle and format time fields, checking for null values
  10.     time_open = record.Time_Open; // Accessing 'Time_Open' directly
  11. time_open_string = time_open.toString("hh:mm a");
  12.     time_close = record.Time_Close; // Accessing 'Time_Close' directly
  13. time_close_string = time_close.toString("hh:mm a");
  14.     

  15.     // Combine the row's information
  16.     combined_info = combined_info + day + ": " + time_open_string + " - " + time_close_string + "\n";
  17. }

  18. // Log combined info for debugging
  19. info "Combined Info: " + combined_info;

  20. // Update the CRM field
  21. newLocation.put("Dock_Hours", combined_info);