Copying row and getting the reference rows (Appointments and Images)

Hi,

I have a scheduling app where I have appointments that have a referenced table for images. I want to be able to make a copy of an appointment and also have the referenced table of images copied over to the new appointment.

Programmatically I need the ApptId of the original appointment, the ApptId of the new appointment and then update the referenced image table to add rows with the new ApptId and all the image url's that match the original ApptId. If that makes sense haha.

Appointment table
ApptId: 1

Image table:
ApptId: 1
ImageURL: appt1-imagehere

Then needs to be this when I click copy:

Appointment table
ApptId: 1
ApptId: 2

Image table:
ApptId: 1
ImageURL: appt1-imagehere
ApptId: 2
ImageURL: appt1-imagehere

0 2 207
2 REPLIES 2
Top Labels in this Space