New

Thank you for adding this item to Sage City Ideas Hub.  Open for voting.

Fully Implement Filtering on the Sage 200 API

I have discovered that it is impossible to filter by certain 'calculated' columns on the API, particularly on the sales_posted_transactions endpoint.

The following API call with a filter to return only Sales Receipts works successfully...

/v1/sales_posted_transactions?$skip=0&$orderby=id&$top=500&$filter=trader_transaction_type eq 'TradingAccountEntryTypePurchasePaymentSalesReceipt'

however as soon as you add any of the 'document_' fields (e.g. outstanding value) into the filter the API returns an error, e.g.

v1/sales_posted_transactions?$skip=0&$orderby=id&$top=500&$filter=trader_transaction_type eq 'TradingAccountEntryTypePurchasePaymentSalesReceipt' and document_outstanding_value gt 0

The error being returned is: Error: {"Invalid column name 'DocumentOutstandingValue'."}

Sage Developer Support have advised that this is due to these columns are 'calculated'.  The API documentation makes no reference to any columns that are unfilterable, so it was extremely disappointing to discover this.  This limitation makes the API useless for many use cases.  For my particular requirement I need to obtain any unallocated/outstanding sales transactions.

I would classify this as a bug rather than a suggestion or feature request.

  • I know this is an old one, but in case anyone else looks at this I found a solution.use the sales_transaction_enquiry_views or purchase_transaction_enquiry_views API calls. Since these seem to expose an underlying database view, the calculated fields are queryable.