Menu

Retrieve OneToMany

Leng
2004-04-06
2004-04-29
  • Leng

    Leng - 2004-04-06

    I can retrieve invoice document and invoice item list but i want to retrieve invoice item list orderby (sort by) some attribute in invoice item

    How Can I Do That?

     
    • Richard Banks

      Richard Banks - 2004-04-07

      You need to add an order attribute to your retrieve criteria.

      Use either addOrderAttribute() or addOrderAttributeByAscend().

      The second call allows you to specify order direction while the first defaults to ascending order.

       
    • Leng

      Leng - 2004-04-29

      would you mind to briefly describe how to use addOrderAttribute() or addOrderAttributeByAscend() ?

      because i am not found method to use with

       
    • Richard Banks

      Richard Banks - 2004-04-29

          criteria.WhereCondition.addSelectEqualTo("Customer", cust)
          criteria.addOrderAttributeByAscend("InvoiceNo", False)
          cursor = criteria.perform(...)

      Will give you all invoices for a customer ordered by descending invoice number.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.