Skip to content

Xero Tracking Categories #315

Answered by pumpkinball
AndyTurff asked this question in Q&A
Feb 21, 2023 · 5 comments · 4 replies
Discussion options

You must be logged in to vote

Hi @AndyTurff I've just tried it on my local. With the array_push, I forgot you have to push into the array after each tracking item.
So I tried this, and it seemed to work..

             $trackingCat = new XeroAPI\XeroPHP\Models\Accounting\LineItemTracking;
	    $trackingCat->setTrackingCategoryId('xxxxxxxx-xxxx-xxxx-97a1-0e6d15b0b574')
					   ->setName('Garden')
				            ->setOption('All Gardens');

		array_push($trackingCats, $trackingCat);	

	    $trackingCat = new XeroAPI\XeroPHP\Models\Accounting\LineItemTracking;
	    $trackingCat->setTrackingCategoryId('xxxxxxxx-xxxx-xxxx-8dcb-9405d571b614')
					   ->setName('Unit')
				            ->setOption('All Units');

	    array_pu…

Replies: 5 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@AndyTurff
Comment options

@AndyTurff
Comment options

Comment options

You must be logged in to vote
1 reply
@AndyTurff
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by AndyTurff
Comment options

You must be logged in to vote
1 reply
@pumpkinball
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants