Method Community

 

SQL Override with > 1 Result

Last post 06-03-2015 3:45 PM by furrywombat. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 06-03-2015 11:55 AM

    SQL Override with > 1 Result

    We are attempting to build a query for an SQL override grid field that could return more than one result, i.e. query Item FullName to determine associated open sales order line items, returning the sales order refnumber. Problem is, all we can do currently is display the most recent, or MAX sales order refnumber. What I would like to do is to present a comma-separated list of values. In MySQL, this would be accomplished using GROUP_CONCAT to present a list of comma-separated values. 

    How can this be accomplished in Method, if at all?

  • 06-03-2015 3:03 PM In reply to

    Re: SQL Override with > 1 Result

    Answer

    Hi FW,

    Unfortunately, this isn’t possible using an SQL override, as they only allow 1 value to be returned. Your only alternative would be to build an action set to loop through the table and build a list. Then store the list in a custom field and display it on your grid.

    Sorry for the inconvenience.

    -Audisho

    Audisho Sada
    Product Manager
    Method:CRM
    a.sada@method.me
    Toll Free: 1.888.925.6238
    Local & Overseas: 416.847.0400
    Fax: 416.640.6027
  • 06-03-2015 3:21 PM In reply to

    Re: SQL Override with > 1 Result

    Not possible, okay, but WHY?

  • 06-03-2015 3:34 PM In reply to

    Re: SQL Override with > 1 Result

    Answer

    Hi FW,

    As I said, the query throws an error if more than one value is returned per field.

    -Audisho

    Audisho Sada
    Product Manager
    Method:CRM
    a.sada@method.me
    Toll Free: 1.888.925.6238
    Local & Overseas: 416.847.0400
    Fax: 416.640.6027
  • 06-03-2015 3:45 PM In reply to

    Re: SQL Override with > 1 Result

    To clarify: Why would you limit us to one result, severly impacting potential functionality that would broadly increase our ability to provide useful grid data?

    Not: Why will a function not complete when it results in error.

Page 1 of 1 (5 items)