eLabSDK2.Journal.Experiment.Section.EquipmentSection
Hierarchy
-
↳
EquipmentSection
Methods
loadEquipment
loadEquipment(sectionId): Promise<PagedInterface<EquipmentLink>>
Load all equipment linked to a specific experiment section.
This retrieves a list of equipment/instruments that have been linked to the specified
experiment section. Equipment sections allow tracking which laboratory instruments were
used during an experiment. Returns a paginated list of equipment links including equipment
details. If loading fails, displays an error dialog to the user.
Parameters
| Name | Type | Description |
|---|---|---|
sectionId | number | The numeric ID of the experiment section to load equipment for. |
Returns
Promise<PagedInterface<EquipmentLink>>
A Promise that resolves with a PagedInterface containing equipment link details.
Example
// Load equipment for a section
const equipmentSection = new eLabSDK2.Journal.Experiment.ExperimentSection.EquipmentSection();
const equipment = await equipmentSection.loadEquipment(456);
console.log(`Found ${equipment.count} equipment items`);
equipment.items.forEach(item => {
console.log(`- ${item.name}`);
});
Example
// Handle errors
const equipmentSection = new eLabSDK2.Journal.Experiment.ExperimentSection.EquipmentSection();
try {
const equipment = await equipmentSection.loadEquipment(123);
displayEquipmentList(equipment.items);
} catch (error) {
console.log('Failed to load equipment');
}
© 2023 eLabNext
Updated about 3 hours ago