Skip to content

List budgets

Shows the code and name of all budgets of the company, or of the budgets that match a pattern.

Budgets come from the Finder with type BDS. budgets()->search() returns a CodeNameSearch with BudgetSummary objects (code, name). For the amounts of a budget, use Budget vs. actual.

$twinfield = Example::twinfield();
// Optional search pattern from the command line, e.g. `2025*`.
$pattern = $argv[1] ?? '*';
foreach ($twinfield->budgets()->search($pattern)->all() as $budget) {
echo $budget->code, ' ', $budget->name, PHP_EOL;
}

Search in names only with ->inName(), or get one page with ->limit(10)->get().

Terminal window
php examples/budgets/list-budgets/example.php
php examples/budgets/list-budgets/example.php "2025*"

Add TWINFIELD_DEBUG=1 to see the SOAP request and response.

001 Budget 2025
002 Forecast 2025

View examples/budgets/list-budgets/example.php on GitHub.

Made by SolveBeam

Twinfield and Wolters Kluwer are trademarks of Wolters Kluwer. Their names and logos are used only to refer to their products.