You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Case Torres <Ca...@casetorrestech.com> on 2008/04/23 00:51:58 UTC

How to list quotes asc?

Hi,

How would I go about listing our quotes in ascending order. The code in
QuoteForms.xml calls performFind (see code below).
It basically gets all quotes and lists them by quoteId in descending order.
Is there a simple tag I can add to change that to asc order? I couldn't find
any examples.

Thanks,

 	<actions>
            <service service-name="performFind" result-map-name="result"
result-map-list-name="listIt">
                <field-map field-name="inputFields" env-name="parameters"/>
                <field-map field-name="entityName" value="Quote"/>
            </service>
        </actions>

---
Case Torres
case@casetorrestech.com



Re: How to list quotes asc?

Posted by Jacopo Cappellato <ja...@gmail.com>.
yeah, you are right Scott!
I still prefer the +- syntax over the ASC/DESC (because it is more  
clearly a different syntax from the SQL one)  but it is definitely a  
matter of personal preference.
Thanks for pointing this out.

Jacopo

On Apr 23, 2008, at 9:48 AM, Scott Gray wrote:

> Hi Jacopo
>
> Much as I hate to argue with you, I think both approaches evaluate  
> to the
> same result.  Have a look at OrderByItem.java, the parse() method,  
> line 66
> in trunk.
>
> Regards
> Scott
>
> 2008/4/23 Jacopo Cappellato <ja...@gmail.com>:
>
>> Scott is right; however the preferred (db independent) syntax is:
>>
>> <field-map field-name="orderBy" value="-quoteId"/>
>>>
>>
>> I.e. you should use a "-" as a prefix to specify the DESC order
>> and a "+" prefix for an ASC order
>>
>> Jacopo
>>
>>
>>
>> On Apr 23, 2008, at 9:22 AM, Scott Gray wrote:
>>
>> Something like this should work:
>>> <field-map field-name="orderBy" value="quoteId DESC"/>
>>> you can add additional fields to sort by using "|" as a separator,  
>>> for
>>> example:
>>> <field-map field-name="orderBy" value="validFromDate DESC |
>>> validThruDate
>>> ASC"/>
>>>
>>> Regards
>>> Scott
>>>
>>> 2008/4/23 Case Torres <Ca...@casetorrestech.com>:
>>>
>>> Hi,
>>>>
>>>> How would I go about listing our quotes in ascending order. The  
>>>> code
>>>> in
>>>> QuoteForms.xml calls performFind (see code below).
>>>> It basically gets all quotes and lists them by quoteId in  
>>>> descending
>>>> order.
>>>> Is there a simple tag I can add to change that to asc order? I
>>>> couldn't
>>>> find
>>>> any examples.
>>>>
>>>> Thanks,
>>>>
>>>>     <actions>
>>>>         <service service-name="performFind" result-map- 
>>>> name="result"
>>>> result-map-list-name="listIt">
>>>>             <field-map field-name="inputFields"
>>>> env-name="parameters"/>
>>>>             <field-map field-name="entityName" value="Quote"/>
>>>>         </service>
>>>>     </actions>
>>>>
>>>> ---
>>>> Case Torres
>>>> case@casetorrestech.com
>>>>
>>>>
>>>>
>>>>
>>


Re: How to list quotes asc?

Posted by Scott Gray <le...@gmail.com>.
Hi Jacopo

Much as I hate to argue with you, I think both approaches evaluate to the
same result.  Have a look at OrderByItem.java, the parse() method, line 66
in trunk.

Regards
Scott

2008/4/23 Jacopo Cappellato <ja...@gmail.com>:

> Scott is right; however the preferred (db independent) syntax is:
>
>  <field-map field-name="orderBy" value="-quoteId"/>
> >
>
> I.e. you should use a "-" as a prefix to specify the DESC order
> and a "+" prefix for an ASC order
>
> Jacopo
>
>
>
> On Apr 23, 2008, at 9:22 AM, Scott Gray wrote:
>
>  Something like this should work:
> > <field-map field-name="orderBy" value="quoteId DESC"/>
> > you can add additional fields to sort by using "|" as a separator, for
> > example:
> > <field-map field-name="orderBy" value="validFromDate DESC |
> > validThruDate
> > ASC"/>
> >
> > Regards
> > Scott
> >
> > 2008/4/23 Case Torres <Ca...@casetorrestech.com>:
> >
> >  Hi,
> > >
> > > How would I go about listing our quotes in ascending order. The code
> > > in
> > > QuoteForms.xml calls performFind (see code below).
> > > It basically gets all quotes and lists them by quoteId in descending
> > > order.
> > > Is there a simple tag I can add to change that to asc order? I
> > > couldn't
> > > find
> > > any examples.
> > >
> > > Thanks,
> > >
> > >      <actions>
> > >          <service service-name="performFind" result-map-name="result"
> > > result-map-list-name="listIt">
> > >              <field-map field-name="inputFields"
> > > env-name="parameters"/>
> > >              <field-map field-name="entityName" value="Quote"/>
> > >          </service>
> > >      </actions>
> > >
> > > ---
> > > Case Torres
> > > case@casetorrestech.com
> > >
> > >
> > >
> > >
>

Re: How to list quotes asc?

Posted by Jacopo Cappellato <ja...@gmail.com>.
Scott is right; however the preferred (db independent) syntax is:

> <field-map field-name="orderBy" value="-quoteId"/>

I.e. you should use a "-" as a prefix to specify the DESC order
and a "+" prefix for an ASC order

Jacopo


On Apr 23, 2008, at 9:22 AM, Scott Gray wrote:

> Something like this should work:
> <field-map field-name="orderBy" value="quoteId DESC"/>
> you can add additional fields to sort by using "|" as a separator, for
> example:
> <field-map field-name="orderBy" value="validFromDate DESC |  
> validThruDate
> ASC"/>
>
> Regards
> Scott
>
> 2008/4/23 Case Torres <Ca...@casetorrestech.com>:
>
>> Hi,
>>
>> How would I go about listing our quotes in ascending order. The  
>> code in
>> QuoteForms.xml calls performFind (see code below).
>> It basically gets all quotes and lists them by quoteId in descending
>> order.
>> Is there a simple tag I can add to change that to asc order? I  
>> couldn't
>> find
>> any examples.
>>
>> Thanks,
>>
>>       <actions>
>>           <service service-name="performFind" result-map- 
>> name="result"
>> result-map-list-name="listIt">
>>               <field-map field-name="inputFields" env- 
>> name="parameters"/>
>>               <field-map field-name="entityName" value="Quote"/>
>>           </service>
>>       </actions>
>>
>> ---
>> Case Torres
>> case@casetorrestech.com
>>
>>
>>


Re: How to list quotes asc?

Posted by Scott Gray <le...@gmail.com>.
Something like this should work:
<field-map field-name="orderBy" value="quoteId DESC"/>
you can add additional fields to sort by using "|" as a separator, for
example:
<field-map field-name="orderBy" value="validFromDate DESC | validThruDate
ASC"/>

Regards
Scott

2008/4/23 Case Torres <Ca...@casetorrestech.com>:

> Hi,
>
> How would I go about listing our quotes in ascending order. The code in
> QuoteForms.xml calls performFind (see code below).
> It basically gets all quotes and lists them by quoteId in descending
> order.
> Is there a simple tag I can add to change that to asc order? I couldn't
> find
> any examples.
>
> Thanks,
>
>        <actions>
>            <service service-name="performFind" result-map-name="result"
> result-map-list-name="listIt">
>                <field-map field-name="inputFields" env-name="parameters"/>
>                <field-map field-name="entityName" value="Quote"/>
>            </service>
>        </actions>
>
> ---
> Case Torres
> case@casetorrestech.com
>
>
>