No records found'; return; } $firstRow = reset($items); if (!is_array($firstRow)) { echo '
' . h(json_encode($items, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)) . '
'; return; } $headers = []; foreach ($items as $row) { if (is_array($row)) { $headers = array_unique(array_merge($headers, array_keys($row))); } } echo '
'; echo ''; echo ''; foreach ($headers as $header) { echo ''; } echo ''; foreach ($items as $row) { echo ''; foreach ($headers as $header) { $value = $row[$header] ?? ''; if (is_array($value) || is_object($value)) { $value = json_encode($value, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); echo ''; } else { echo ''; } } echo ''; } echo '
' . h($header) . '
' . h($value) . '
' . h($value) . '
'; echo '
'; } try { if ($entityId > 0) { $api = VisualLimsApiClient::getInstance(); // Default expands for better debugging if ($customExpand !== '') { $expand = $customExpand; } else { if ($entityType === 'CommessaWeb') { $expand = implode(',', [ 'CommesseCustomFields($expand=CustomField)', 'Campioni' ]); } else { $expand = implode(',', [ 'CommesseCustomFields($expand=CustomField)', 'Campioni' ]); } } $rawEndpoint = $entityType . '(' . $entityId . ')?$expand=' . $expand; $result = $api->get($rawEndpoint); } } catch (Exception $e) { $error = $e->getMessage(); } ?> Debug Commessa API

Commessa / CommessaWeb API Inspector

Requested Endpoint
API Error:
Main Information
ID
Code
Cliente
SchemaCustomField
Richiedente
Descrizione
Direct Properties
CommesseCustomFields
$field['IdCommesseCustomFields'] ?? '', 'Valore' => $field['Valore'] ?? '', 'CustomFieldId' => $field['CustomField']['IdCustomField'] ?? '', 'Label' => $field['CustomField']['Descrizione'] ?? ($field['CustomField']['Name'] ?? ''), 'Tipo' => $field['CustomField']['Tipo'] ?? '', ]; } renderArrayAsTable($fieldsRows); ?>
Campioni
Raw JSON
0 && !$error): ?>
No data returned from API