List activities
Lists the code and name of all activities of the company.
Activities are dimensions of type ACT: in Twinfield Time & Expenses, hours are booked on an activity of a project. activities()->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 an ActivitySummary with code and name. Use get() for all settings of an activity (see Read activity).
$twinfield = Example::twinfield();
foreach ($twinfield->activities()->search()->all() as $activity) { echo $activity->code, ' ', $activity->name, PHP_EOL;}php examples/activities/list-activities/example.phpAdd TWINFIELD_DEBUG=1 to see the SOAP request and response.
A001 Financial administrationA002 VAT returnSource
Section titled “Source”View examples/activities/list-activities/example.php on GitHub.