call()

The string-based entry point for host methods on the Dashlet handle. It is a thin passthrough: the seven portable method names route through the same dispatch core as the typed facade, so the two surfaces cannot drift; any other name follows the host-specific raw path — the documented escape hatch of the respective handle (webclient handle — call() and rich-client handle — call()).

1. Signature

call<T = unknown>(method: string, params?: unknown[]): Promise<T>;
  • method — the host method name (e.g. 'getSelectedObjects', 'openIndexData', or any host method you call raw).

  • params — the argument array posted with the call (default []).

2. Per-host dispatch

Host / state Behavior

destroyed

Rejects immediately with Error('dashlet destroyed').

portable method name (any host)

Routes through the same PORTABLE dispatch core as the typed facade — identical wire posts, identical resolve values, identical error paths. The seven names: openIndexData, openObject, openLocation, openHitListByIds, refreshHitListObjects, getSelectedObjects, resetSessionTimeout. openHitListByIds keeps its fire-and-forget rule — see openHitListByIds.

unknown name, rich client

Rejects with a descriptive TypeError (the bridge read is definitive even when a webclient origin is configured — the wire would post a message the rich client never answers). The documented rich-client counterpart is call on the getRichClientApi handle.

unknown name, webclient

Posts [method, params, { msgId }] on the wire, bounded by timeoutMs; resolves with the host’s result, rejects with the host’s { error } payload. The documented webclient counterpart is call on the getWebclientApi handle.

standalone (or still detecting without a wire)

Rejects (bounded) with TimeoutError — no host reply path exists.

All seven portable names share the dispatch core, so the string-based call and the typed facade are behaviorally identical when the argument shape matches the per-method normalization. Each portable method accepts either the positional wire array or the plain options object — both normalize to the same wire post. For openIndexData that is the array [inNewTab, mode, objectId, objectTypeId?] or the object { inNewTab, mode, objectId, objectTypeId? }.

3. Examples

// portable name — same dispatch core as the typed facade
const sel = await dashlet.call('getSelectedObjects');

// portable name, positional array form — identical to
// dashlet.openIndexData({ inNewTab: false, mode: 'view', objectId: '1024' })
const ok = await dashlet.call('openIndexData', [false, 'view', '1024']);

// non-portable name — raw webclient passthrough (any host method name not
// in the 7 portable ones posts as [method, params, { msgId }])
await dashlet.call('myOtherHostMethod', ['arg1', 'arg2']);

4. Errors

  • Error('dashlet destroyed') — the dashlet was destroyed before the call.

  • TypeError — an unmapped method in the rich client, or a descriptive argument-validation error from the portable core (e.g. an invalid object id).

  • TimeoutError — bounded no-reply in standalone, or a host that never answered within timeoutMs.

  • The host’s { error } payload — when the host reports a failure on a webclient method call.