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.
Historical Number
PRI49263
Product Synonym
[<p><b>]Fact[</b><p>];
Was this topic helpful?
Document Information
Modified date:
16 June 2018
UID
swg21525330