// Example function to call a FileMaker script via OData async function runFileMakerScript(scriptName: string, params: Record = {}) { const queryParams = new URLSearchParams(params).toString(); const url = `/api/odata/YourTable/fm.script.${scriptName}?${queryParams}`; try { const response = await fetch(url, { headers: { 'X-Host-Id': 'host1', // or 'host2' based on your configuration 'Content-Type': 'application/json', // Add other required headers } }); return await response.json(); } catch (error) { console.error('Error executing script:', error); throw error; } } // Example usage const result = await runFileMakerScript('ProcessClient', { clientId: '12345', action: 'approve' });