ITメモ

ITのこと学習中

Business Central APIを使って試算表、貸借対照表、損益計算書を出力する

Business Central外で試算表、貸借対照表損益計算書を表示する方法として、Business Central APIを利用して表示させられます。ExcelやPower BIを利用すると、組織アカウントでのみ出力ということもできます。

利用方法は簡単。https://api.businesscentral.dynamics.com/v2.0/<テナントID or ドメイン>/<環境名>/api/v2.0/companies(<会社ID>)/
の後にそれぞれ、

試算表の場合 trialBalances
貸借対照表の場合 balanceSheets
損益計算書の場合 incomeStatements

と日付のフィルターをつけて出力できます。

以下、Buciness CentralのIncome statement(損益計算書)取得例。Power BI DesktopはWindowsでのみのため、今回はExcelでデータを取得してみた。Excelを利用すれば、WindowsMacどちらでも対応できます。

Business Central API URL for income statement

API URL例(income statement 損益計算書

ExcelのPower Queryで、Business Centralの損益計算書データを確認

Business Central Income Statement on Excel Power Query

閉じて読み込むと、Excelで利用できます。

Business Central Income Statement on Excel

同様にPower BIでも利用可能。

途中で接続の資格情報が出る場合、組織アカウントを選択しいつもBusiness Centralにアクセスしているサインイン情報を入力します。

参考:Working with API Limits in Dynamics 365 Business Central - Business Central | Microsoft Learn