You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can also send multiple objects in one batch, chunking is handled automatically.
96
96
97
+
### Browse data
98
+
In order to get financial data out of Twinfield like general ledger transactions, sales invoices, and so on, you can use the the browse data functionality.
99
+
More information about the browse data functionality in Twinfield can be found in the [documentation](https://c3.twinfield.com/webservices/documentation/#/ApiReference/Request/BrowseData).
100
+
101
+
#### Browse definition
102
+
103
+
You can retrieve the browse definition of a browse code as follows.
104
+
You don't need to retrieve the browse definition for getting the browse data. It's only for viewing the browse definition of a browse code to know exactly which columns are available.
105
+
106
+
```php
107
+
$connector = new BrowseDataApiConnector($connection);
You don't need to retrieve the browse fields for getting the browse data. It's only for viewing the definitions of all browse fields so you now what you can expect when retrieving browse data.
115
+
116
+
```php
117
+
$connector = new BrowseDataApiConnector($connection);
118
+
$browseFields = $connector->getBrowseFields();
119
+
```
120
+
121
+
#### Browse data
122
+
123
+
You can retrieve browse data of a browse code as follows.
124
+
125
+
```php
126
+
$connector = new BrowseDataApiConnector($connection);
127
+
128
+
// First, create the columns that you want to retrieve (see the browse definition for which columns are available)
129
+
$columns[] = (new BrowseColumn())
130
+
->setField('fin.trs.head.yearperiod')
131
+
->setLabel('Period')
132
+
->setVisible(true)
133
+
->setAsk(true)
134
+
->setOperator('between')
135
+
->setFrom('2013/01')
136
+
->setTo('2013/12');
137
+
138
+
$columns[] = (new BrowseColumn())
139
+
->setField('fin.trs.head.code')
140
+
->setLabel('Transaction type')
141
+
->setVisible(true);
142
+
143
+
$columns[] = (new BrowseColumn())
144
+
->setField('fin.trs.head.shortname')
145
+
->setLabel('Name')
146
+
->setVisible(true);
147
+
148
+
$columns[] = (new BrowseColumn())
149
+
->setField('fin.trs.head.number')
150
+
->setLabel('Trans. no.')
151
+
->setVisible(true);
152
+
153
+
$columns[] = (new BrowseColumn())
154
+
->setField('fin.trs.line.dim1')
155
+
->setLabel('General ledger')
156
+
->setVisible(true)
157
+
->setAsk(true)
158
+
->setOperator('between')
159
+
->setFrom('1300')
160
+
->setTo('1300');
161
+
162
+
$columns[] = (new BrowseColumn())
163
+
->setField('fin.trs.head.curcode')
164
+
->setLabel('Currency')
165
+
->setVisible(true);
166
+
167
+
$columns[] = (new BrowseColumn())
168
+
->setField('fin.trs.line.valuesigned')
169
+
->setLabel('Value')
170
+
->setVisible(true);
171
+
172
+
$columns[] = (new BrowseColumn())
173
+
->setField('fin.trs.line.description')
174
+
->setLabel('Description')
175
+
->setVisible(true);
176
+
177
+
// Second, create sort fields
178
+
$sortFields[] = new BrowseSortField('fin.trs.head.code');
0 commit comments