IBM Support

Filtering API results based on a range of attribute value (Keywords: QryType, BETWEEN, search) extended date search

Troubleshooting


Problem

Filtering API results based on a range of attribute value (Keywords: QryType, BETWEEN, search) extended date search

Symptom

PART: Yantra 5.5

How to filter results of getOrderLineList API so that only those lines are fetched which are in between "Created" and "Released" status?

Cause

Resolving The Problem

Use the following input xml:
<OrderLine FromStatus="1100" StatusQryType="BETWEEN" ToStatus="3200">
<Order/>
</OrderLine>
Infact, this is a very general solution. For any attribute, if you want to filter records based on a range of attribute value, use this. Create three additional XML attributes as described below:
From<attribute_name>, To<attribute_name>, <attribute_name>QryTpe="BETWEEN"
and run the query. It should return the results based on the range specified.
This range search also works for extension fields. For example, if an extension field is created, to capture the number of days by which an orderline's delivery is delayed. Lets name this extension field 'DaysLate'. If we want to find all orderlines which are delivered more than 2 days late but less than a week late. The follwoing input xml should be used:
<OrderLine>
<Extn FromDaysLate="2" ToDaysLate="7" DaysLateQryType="BETWEEN" />
<Order/>
</OrderLine>
This construct of prepending "From" and "To" to attribute names is supported by the Yantra framework for all APIs. It is not just limited to getOrderLineList API.

[{"Product":{"code":"SS6PEW","label":"IBM Sterling Order Management"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Component":"Not Applicable","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Historical Number

PRI49263

Product Synonym

[<p><b>]Fact[</b><p>];

Document Information

Modified date:
16 June 2018

UID

swg21525330