Hopefully, a simple query.
I’m looping through the records in my object as follows…
for (ltime in ltimes){
slot = 0;
slot_found = 0;
while (slot_found === 0){
if (slots_list[slot][mats.ref(‘SlotTime’).trim()] === ltimes[ltime]) {
if (slots_list[slot][mats.ref(‘slotStatus’)] === ‘NULL’) {
if (slots_list[slot][mats.ref(‘SlotService’)] === ‘HPT’) {
cs.log(slots_list[slot][mats.ref(‘SlotDate’)] + slots_list[slot][mats.ref(‘SlotTime’)] + slots_list[slot][mats.ref(‘SlotService’)] + slots_list[slot][mats.ref(‘SlotRoom’)] + slots_list[slot][mats.ref(‘SlotOfficer’)] + slots_list[slot][mats.ref(‘slotStatus’)]);
slot_found++;
});
}
}
}
slot++
}
}
…The data printed to the console is what I expect. However, I want to update the records, instead of printing them. Using the helpfiles, I replace my “cs.log” statement with…
let record = (slots_list[slot]);
record.set(mats.ref(‘slotStatus’),‘AVAILABLE’);
…but in the console I get…
TypeError: record.set is not a function
What am I doing wrong?
Thaks
Stephen