When to use this endpoint

Use PowerBI_getStockData for the Stock table in the legacy connector.

Authentication and permissions

The request must authenticate with signed API-key fields or a logged-in CRM session so that the tenant database and user context are available. The handler performs no page or role-permission check.

This direct dataset route does not consume the unsigned api_id/api_key pair used by the Power BI connector. Use PowerBI_getData for the self-authenticating connector feed.

Parameters

This endpoint has no operation-specific parameters.

Example request

FM_api('PowerBI_getStockData');

Example response

[
  {"stock_id":"12","stock_name":"Filter","categories":"[3]","code":"FILTER","cost":"12.50","date_created":"2026-01-02 10:00:00","description":"Replacement filter","in_stock":"8","is_archived":"No","last_edited":"1727441000","nominal_code":"5000","notes":"","owner_id":"0","price":"25.00","supplier_id":"9","supplier_name":"Parts Ltd","tax_rate":"20","trigger_settings":"{}"}
]

Errors and unusual responses

ResponseCondition
{"error":"not logged in"}No authenticated tenant context is available. Invalid signed credentials can be rejected by the dispatcher before the handler runs.

Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.

Behaviour and edge cases

  • Soft-deleted stock is excluded and rows are ordered by stock name descending. Archived stock is still included, with is_archived mapped to Yes or No.
  • Supplier names resolve only from nondeleted suppliers. Other values, including categories and trigger settings, remain in their stored scalar/JSON-string representations.
  • There is no date filter, search, or pagination.
  • The aggregate feed exposes the array as stock_data for module=all-stock and includes it in module=all.

See it in Fieldmotion

CRM1

The legacy connector uses this result as its Stock table.

CRM2

CRM2 does not call this reporting route for stock screens.

Related endpoints

  • PowerBI_getData is the supported aggregate connector feed and supplies tenant settings to this helper.
  • PowerBI_authenticate establishes the unsigned connector session used by the aggregate feed.