List projects
Lists the code and name of all projects of the company.
Projects are dimensions of type PRJ. In Twinfield Time & Expenses, hours are booked on an activity of a project; in the ledger, projects are dimensions at level 3 (activities at level 4). projects()->search() searches them with the Finder; all() goes through all pages for you, fetching the next page only when you get there.
Each result is a ProjectSummary with code and name. Use get() for all settings of a project (see Read project).
$twinfield = Example::twinfield();
foreach ($twinfield->projects()->search()->all() as $project) { echo $project->code, ' ', $project->name, PHP_EOL;}php examples/projects/list-projects/example.phpAdd TWINFIELD_DEBUG=1 to see the SOAP request and response.
P0001 Website redesignP0002 Internal projects & overheadSource
Section titled “Source”View examples/projects/list-projects/example.php on GitHub.
Twinfield and Wolters Kluwer are trademarks of Wolters Kluwer. Their names and logos are used only to refer to their products.