Hello All,
I have a Business Entity Class with a Read Operation, However, I need to to be able to pass multiple values to the filter. Looking through all the random stuff I could find on the Internet it looks like defining the Input Parameter as an Array seems to be the best option
Now the question I am challenged with is how do I construct my HTTP parameters
I am indeed a newbie to Data Services and cannot seem to find any documentation around this
@openapi.openedge.export(type="REST", useReturnValue="false", writeDataSetBeforeImage="false").
@progress.service.resourceMapping(type="REST", operation="read", URI="?filter=~{filter~}", alias="", mediaType="application/json").
METHOD PUBLIC VOID ReadUIObjects(
INPUT filter AS CHARACTER EXTENT,
OUTPUT DATASET dsUIObjects):
MESSAGE 'READING UI OBJECTS'.
MESSAGE "1" filter[0] skip "2" filter[1].
END METHOD.
Hello,
When working with Data Object Services, you can use the filter CHARACTER parameter as a freeform string and have your own code on the Business Entity to interpret the content.
For example, to pass an array, the string parameter can have a comma-delimited list of values or a serialized JSON object.
Are you working with JavaScript on the client-side?
A possible approach in JavaScript would be to serialize the array into a string then pass the string in the request and de-serialize the string on the Business Entity side.
On the client side, you would use JSON.stringify(array) and on the ABL side, you would use something like "CAST(jsonParser:Parse(filter), jsonObject)" to convert the filter parameter to a JSON object.
We use this approach to overload the filter parameter and pass Kendo UI filter queries. We call this approach JSON Filter Pattern (JFP).
(If you are working with the JSDO, you can add your own plugins to implement your own filter pattern.)
Here is the link showing the sample implementation for JFP:
- documentation.progress.com/.../index.html
Please let me know if you need more info on this approach.
I hope this helps.