Convert IDs returned in a list to the names they're associated with
Hi there,
I have a multi line field on a statless form that I want to populate with a list of names fetched from a set of records meeting a certain criteria. There are 3 forms connected to this process:
Client_Info (this just holds the basic client info like First Name, Last Name, Client ID, email, phone no. etc.)
Courses_Setup (this holds a uniques record for each course that has been setup, with fields for course title, room it's held in, strat and end dates, teacher etc.
Class_Bookings (this holds all the records for each client booking on a range of classes within each unique course. It has a Look up field for the Client (linked to Client_Info) and a lookup field for the Course (linked to Courses_Setup).
The stateless form (called "Cancel_Clients") is a pop-up that warns the user if they want to change dates on a course for which there are already clients booked. As a helpful reminder I want the multi line field on this stateless form to show a list of all the client names that are booked on to the dates about to be changed (the names will just be for reference).
Now, I can successfully populate the list with the correct IDs corresponding to the relevant Clients. But I really want to display the First and Last named grabbed from the Client_info form. But I'm struggling to find the correct script.
Here's what I have so far, inserted into the 'On Load' section of the Cancel_Clients stateless form:
rec = Courses_Setup [ID = input.Course];
weekcheck2 = Class_Bookings [((BkCourse_ID = rec.Course_ID && (Booking_Status == "Booked" || Booking_Status == "Exchanged in")) && Booking_Date_Time == rec.Week2)]; /
/this is just filtering out the correct booking records from the Class_Bookings form
temp = "";
for each item in weekcheck2
{
temp = temp + item.Client + ", ";
}
input.Clients_List = temp;
//the Clients_List field is the multi line field on the statless form
I would really appreciate if someone could show me how to convert the IDs that are returned as 'item.Client' into the corresponding First and Last names.
Best regards.