ForAll(
colSelectedShelves,
Patch(
First(
Sort(
Filter(
'AV Asset Bookings Log',
Title = ThisRecord.Title && Room = ThisRecord.Room
),
'Booked Date',
SortOrder.Descending
)
),
{
'Shelved Date': Now(),
'Shelved By': {
Claims: "i:0#.f|membership|" & technicianProfile.userPrincipalName,
DisplayName: "",
Email: technicianProfile.mail,
Department: "",
JobTitle: "",
Picture: ""
}
}
);
Remove(
'AV Asset Bookings Active List',
LookUp(
'AV Asset Bookings Active List',
Title = ThisRecord.Title && Room = ThisRecord.Room
)
);
);
Clear(colSelectedShelves);
Refresh('AV Asset Bookings Active List');
ClearCollect(
colLog,
'AV Asset Bookings Log'
);
ClearCollect(
colActive,
'AV Asset Bookings Active List'
);
ForAll(
colSelectedShelves As shelf,
With(
{
currentLogItem: First(
SortByColumns(
Filter(
colLog,
Title = shelf.Title && Room = shelf.Room
),
"BookedDate",
"Descending"
)
),
currentActiveItem: LookUp(
colActive,
Title = shelf.Title && Room = shelf.Room
)
},
Patch(
'AV Asset Bookings Log',
currentLogItem,
{
'Shelved Date': Now(),
'Shelved By': {
Claims: "i:0#.f|membership|" & technicianProfile.userPrincipalName,
DisplayName: "",
Email: technicianProfile.mail,
Department: "",
JobTitle: "",
Picture: ""
}
}
);
Remove(
'AV Asset Bookings Active List',
LookUp(
'AV Asset Bookings Active List',
Title = shelf.Title && Room = shelf.Room
)
);
)
);
Clear(colSelectedShelves);
Refresh('AV Asset Bookings Active List');
Refresh('AV Asset Bookings Log');
ClearCollect(colLog, 'AV Asset Bookings Log');
ClearCollect(colActive, 'AV Asset Bookings Active List');
ForAll(
colSelectedShelves,
With(
{
currentLogItem: First(
SortByColumns(
Filter(
colLog,
Title = ThisRecord.Title &&
Room = ThisRecord.Room
),
"Booked Date",
Descending
)
),
currentActiveItem: LookUp(
colActive,
Title = ThisRecord.Title &&
Room = ThisRecord.Room
)
},
Patch(
'AV Asset Bookings Log',
currentLogItem,
{
'Shelved Date': Now(),
'Shelved By': {
Claims: "i:0#.f|membership|" & technicianProfile.userPrincipalName,
DisplayName: "",
Email: technicianProfile.mail,
Department: "",
JobTitle: "",
Picture: ""
}
}
);
Remove(
'AV Asset Bookings Active List',
currentActiveItem
)
)
);
Clear(colSelectedShelves);
Refresh('AV Asset Bookings Active List');
Refresh('AV Asset Bookings Log');
Title in colSelectedShelves.Title && Room in colSelectedShelves.Room
ForAll(
colSelectedShelves,
With(
{
currentLogItem: First(
Sort(
Filter(
'AV Asset Bookings Log',
Title = ThisRecord.Title &&
Room = ThisRecord.Room
),
'Booked Date',
Descending
)
),
currentActiveItem: LookUp(
'AV Asset Bookings Active List',
Title = ThisRecord.Title &&
Room = ThisRecord.Room
)
},
Collect(
colToPatch,
Patch(
currentLogItem,
{
'Shelved Date': Now(),
'Shelved By': {
Claims: "i:0#.f|membership|" & technicianProfile.userPrincipalName,
DisplayName: "",
Email: technicianProfile.mail,
Department: "",
JobTitle: "",
Picture: ""
}
}
)
);
Remove(
'AV Asset Bookings Active List',
currentActiveItem
)
)
);
Clear(colSelectedShelves);
Refresh('AV Asset Bookings Active List');