Vardhan - Tuesday, April 15, 2014 9:02 AM:
Hi,
I am using following query to get items, it gets all the items if I don't use 'order by'.
BLOCKED SCRIPT
var Items_ = inn.newItem("Formulas","get");
Items_.setAttribute("where","[Formulas].state = 'Approved' order by [Formulas].approved_date desc ");
var results = Items.apply();
This is not getting the items. How to use order by in the above query?
Thank you.
Brian - Sunday, May 11, 2014 9:54 PM:
Hi Vardh,
OrderBy is a separate attribute that you set on the item.
var Items_ = inn.newItem("Formulas","get");
Items_.setAttribute("where","[Formulas].state = 'Approved'");
items_.setAttribute("orderBy", "[Formulas].approved_date desc ");
var results = Items.apply();
should do what you want.
Hope this helps,
Brian.
Vardhan - Monday, May 12, 2014 5:46 AM:
Thank you so much Brian.