Hello, with ANM21 I need to get a table record list thru api, filtered on ONE or MORE fields.
If I run the GET LIST all is ok and I can get the JSON with all records.
How can I filter the list to get filtered records? Which is the correct syntax? There isn't any example in the docs.
Referring to the online doc: <Field>=<FieldValue> (Optional, search field by value, requires activating the Advanced/Extended Search setting in List page):
1) <Field> is the real db field (CustomerID) or something like x_CustomerID ?
2) which is the correct setting to setup? "Ext. Search" flag at field level or (Search) Extended or Advanced at table level? Or maybe the twos?
3) in the following example in my "documents" table I want to get all the documents with CustomerID=100 (is numeric) AND with DocDate BETWEEN two values: how can I pass the field parameters to the ajax call? with data?
4) It is impossible to create OR based fields search, right? If I specify more fields to search I always have AND condition, right?
Thank you
$("#btn-list").click(function() {
$.ajax({
url: "https://www.mysite/api/list/documents",
method: "GET",
data: { CustomerID:"100"}, // this doesn't work!!!
success: function(data, status, xhr) {
var out = (data && typeof data === 'object') ? JSON.stringify(data) : data;
alert("OK!" + out);
console.log(out);
},
error: function (xhr, ajaxOptions, thrownError) {
alert("KO!!!!! - status: " + xhr.status + ", error: " + thrownError);
},
beforeSend: function(request) { // Set JWT header
request.setRequestHeader('Authorization', 'Bearer ' + store.JWT);
}
});
});